warframe-assistant

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 1 Imported by: 0

README

Warframe Assistant

A discord bot to host in game events

Features

  • Based on bwmarrin/discordgo & spf13/cobra
  • Discord slash commands :)
  • BUTTONS
  • IGN management - associate the users in your discord server with their in game name
  • Event management - host events, set start / end dates, allow your users to submit proofs to claim score, and moderators to verify / update / confirm the scores with emoji reactions, allow any user to check current event status
  • Deployable to heroku, alternatively build the docker image and run in your preferred environment
  • Use the /help command to learn more about the bot
  • Shell completion - who needs shell completion for a server app anyway? but hey

Supported event types

  • Scoreboard Campaign
    • Users submit scores with proofs, mods to verify the scores, and leaderboard is generated with the sum of all submissions from a user
  • Scoreboard Leaderboard (I know the name is whack)
    • Same with Scoreboard campaign except for only the top score from each user counts

Configurations

Configurations can be taken from either environment variable, command line arguments, or a config file, they need to be in all caps if they were to be taken from environment variables. Otherwise a wide variety of file formats can be used by starting the server with, for example, ... serveBot --config ./conf.json. Config file defaults to $HOME/.warframe-assistant.yaml.

Configs:

name description required default
bot_token Discord bot token, you may get one by creating your own discord bot, see discord documentation for more details yes
database_url Database DSN to connect to your Postgres database, the required tables can be created with the /db.sql script yes
redis_url DSN to connect to a redis instance, if omitted, an in memory cache will be used no
log_level Log level of the zap logger used, see here for a list of available levels no info

If you are hosting the bot yourself, you will need the following scopes and bot permissions to add it to a server:

  • Scopes:
    • bot
    • application.commands
  • Bot permissions:
    • Send Messages
    • Manage Messages
    • Add Reactions
    • Embed Links
  • You may run the registerCommands command to register the slash commands with discord, slash commands are cached and these may take some time to get propagated to your servers as per discord documentation, bot_token will be required

Caveats

  • The db table names are unfortunately hard coded in the initialization steps in ./cmd/serveBot.go, this may get taken out as configurable at a future date
  • If more event types were added, the command description in the /events create will have a problem due to exceeding word limit
  • Function docs will be added one day (tm)

Contribution

For feature requests / concerns feel free to make an issue, PR is welcome, if you think the documentation could be improved feel free to make an issue to request clarification as well. I'm looking for people to collaborate on the project.

Testing

Running tests requires access to docker - ory/dockertest is used and it will automatically detect docker access most of the times, if test crashed it might leave hanging docker containers running postgres, you need to purge those manually if that happened.

Documentation

Overview

Copyright © 2021 Shiqi Zhao <zhao.shiqi.art@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL