🤖 Your friendly neighborhood discord bot.
You'll need the following env vars (either .env
or however you want to supply):
DISCORD_TOKEN= # discord bot token
IEX_PUB_TOKEN= # public token for iex cloud
IEX_SECRET_TOKEN= # secret token for iex cloud
REDIS_URL= # redis:// style connection URL
Then setup:
rob@local$ script/setup
Then run:
rob@local$ script/setup
Use the generator script:
rob@local$ script/generate-command -n foobar
command file generated: /workspaces/reb-bot/lib/commands/foobar.rb
And add your changes to the generated file.
For bots that use slash commands, they must be registered with Discord. Commands can be registered globally, or to a specific server. During development, it's recommended to register to a specific server since it will update instantly, then register it globally when ready.
Open a debug console with script/console
:
server_id = Rebbot::TEST_SERVER_ID # or nil for global
# clean up old commands
bot.delete_commands!(server_id)
# register new commands
bot.register_commands!(server_id)