Skip to content

amansomething/discord_bot_testing

Repository files navigation

Discord Bot Testing with Fly.io

A simple Discord bot that notifies a channel when an event is added, updated, or deleted from a server.

Local Testing

Pre-requisites

  • Discord Bot Token (See: https://discord.com/developers/docs/quick-start/getting-started)
  • Discord Channel IDs (Last part of the channel URL, e.g., https://discord.com/channels/123/5678 -> 5678)
    • ANNOUNCEMENTS_CHANNEL_ID - Where to send notifications about new, updated, and cancelled events.
    • EVENTS_CHANNEL_ID - Where to create discussion threads for events ending soon.

Run Locally

Create a .env file with the following vars:

DISCORD_TOKEN="asdf.ghjkl"
ANNOUNCEMENTS_CHANNEL_ID="1234"
EVENTS_CHANNEL_ID="2345"

Run the bot with the following command:

docker compose up

Update Cloud Deployment

Directly on Fly.io

  • Run fly deploy after making the code changes.
  • If two machines end up being deployed, scale down using fly scale count 1.

Note: Fly.io only uses the Dockerfile and ignores the compose.yml file.

Using GitHub Actions

  • GitHub Actions are set up to automatically deploy the bot to Fly.io on every push to the main branch.

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published