This bot is based off of the amazing Svelte Bot. It's hosted on a DigitalOcean App instance that will automatically detect any updates to the main branch and deploy those changes.
- Environment: All secrets should be in a
.envfile. The template/example can be found at env.exampleNODE_ENV: Any value other thanproductionwill set the bot use the dev IDs defined belowDISCORD_TOKEN: The bot's private token from DiscordDEV_GUILD_ID: Guide/server to test the bot inDEV_ADMIN_ROLE: A role or user ID that the bot will consider an administratorDEV_HELP_CHANNEL: Channel(s) to automatically thread any messages in (see the Threads functionality below)DEV_SUPPORT_FORUM_CHANNEL: Support forum channel id
src/config.ts: The bots main config is located at src/config.tsADMIN_ROLES: Role or user IDs that the bot will consider administratorsBOT_DEVS: Currently the same functionality asADMIN_ROLESAUTO_THREAD_CHANNELS: Channel(s) that automatically thread any messages sent in them (extendsHELP_CHANNELSbelow)HELP_CHANNELS: Channel(s) that in addition to being auto threaded also come with issue handling capabilities
on_message_auto_thread: Monitors the channels set inAUTO_THREAD_CHANNELSand automatically turns any messages posted there into their own threads
thread: These are commands to manage the autothreads created by the bot. They can be used by the person who initiated the thread or by people/roles defined in the role./thread rename: Renames the current thread/thread solve: Removes ? and adds ✅ at the beginning of the thread name and sets the archive duration to 1hr/thread archive: Archive an active thread without marking it as solved/thread reopen: Reopen a thread that's been accidentally marked as solved
threads: These are commands to manage all threads in the guild/threads list: Lists currently active threads in the channel the command was ran in
Click on the links below to view the documentation on the different parts of the bot's tech stack:
All contributions are welcome, please try and make an issue first since most new features might warrant a discussion beforehand. Bug fixes probably won't need an issue and direct pull requests are ok for them.
-
Once you have the bot cloned then you need to make a .env file and fill out the fields:
cp .env.example .env
-
Run the bot with
pnpm dev
Since there is no user facing code, prefer snake_case for variables and function names wherever possible. Local constants follow the same, whereas global constants should be in SCREAMING_SNAKE_CASE.
The bot uses the tsm module loader to transpile its Typescript code on the fly so there's no build step involved.
pnpm start