This bot supports operations in the Progressive Victory Discord Server. To join, sign up on the website.
The Progressive Victory Discord bot runs in a Docker container deployed to the GCP Compute Engine. The bot uses:
- pnpm to manage dependencies
- MongoDB as a (document) database
- Mongoose to interact with the database
- express.js to implement RESTful APIs
- NOTE: Currently, the PV bot doesn't define any RESTful API routes or handlers. The long-term vision is for the PV bot to act as a proxy for requests to the Discord API.
To contribute to this repo, follow the contribution standards and instructions outlined on the project home page.
To get started we recommend you install the following software:
- git
- Visual Studio Code
- Node.js v20.12.2 or later
Follow the installation instructions for Node.js. Then, run the following:
npm install -g pnpm@latest-10Finally, copy ./.env.sample to a file ./.env then edit the following vaules to be accurate:
DISCORD_TOKEN="<BOT_TOKEN>"
MONGODB_URI="<MONGODB_DEV_URI>"
PORT=<PORT>You can ask the current tech director to provide these values.
The following actions must be completed to run the bot:
First, install all dependencies:
pnpm installBuild and run the bot:
pnpm devIf the bot fails to run, check that all values are correct in the ./.env file. Otherwise, if everything succeeds, you should be able to send commands to the bot via the Dev Discord server.
To build the documentation, first run
pnpm docThen, open ./docs/index.html in a browser.
Commands help users interact with the server and manage its members:
State lead tools. This command has two subcommands:
- ping - Allows our state leads to ping members' state roles
- members - Gets a list of all members with a specified role
Directs members to the GitHub issues page to submit feedback and report bugs.
Moderation tools. This command has four subcommands:
- create - Add a warning to a user
- update - Update an existing warning
- remove - Remove an existing warning
- view - Gets a filterable list of all warnings
Admin tools for managing the server structure. This command has four subcommands:
- warn channels - Configure which channels are used to manage warnings
- report channels - Configure which channels are used to manage reports
- welcome channel - Configure which channel to send join logs to
- logging channels - Configure which channels logs are sent to
Moderation tool to timeout a user for a specified duration.
Admin tools for managing the server structure for states. This command has two subcommands:
- team set - Set a state's team channel and role
- set - Set a state's channel and role
Moderation tool to mute a user for a specified duration.
Context menus provide actions that can be taken on users and messages.
- Report User: Report a user to the mods
- Report Message: Report a message to the mods
- dockerfile contains the instructions to build the Discord bot's Docker image.
- cloudbuild.yml contains the GCP build configuration, which defines:
- Startup scripts
- The destination for logs
- Managing secrets such as the bot's Discord token and the MongoDB URI
- commands defines the various commands users can use to trigger PV bot workflows:
- commands/chat defines the various chat commands (slash commands) users can use
- commands/context_menu defines the various context menu commands users can use
- events defines the various client events that the PV bot uses to interact with Discord.
- interactions defines the various interactive components the PV bot can send to users to enhance the functionality of commands
- interactions/buttons defines various button interactions
- interactions/modals defines various modal interactions
- interactions/select_menus defines various select menu interactions