with Ruby and sinatra
Guild command registration sample
DISCORD_APPLICATION_ID="123" DISCORD_GUILD_ID="123" DISCORD_BOT_TOKEN="bot_token" bundle exec ruby script/register_command.rb
Set up a server to handle events from Discord. bot.rb is handling the POST /discord/events
endpoint, returning a response to the command /echo
.
bundle exec rackup config.ru -p PORT_NUMBER
Go to https://discord.com/developers/applications/{your_app_id}/information
Here is /echo
outputs.