Discord bot made for Undertale/Deltarune Wiki's Discord server. It is meant to run through Cloudflare Workers.
The bot can be configured for local development using either a .dev.vars file (for development) or a .env file (for production). The production file is only used when running maintenance scripts. The available configuration variables are:
APP_ID: Discord application's IDBOT_TOKEN: Discord bot tokenBOT_PUBLIC_KEY: Discord application's public key (for command verification)VERIFY_GUILD: ID of the server used for wiki account verificationVERIFY_ROLE: ID of the role given to users who verify their wiki accountVERIFY_USERNAME_CHANNEL: ID of the channel where the bot should post whenever a user successfully verifies their wiki accountVERIFY_CHANNEL: ID of the channel where the bot should post a message with the verification buttonVERIFY_MESSAGE: ID of the message in the verification channel which the bot should edit instead of posting anewOAUTH_CLIENT_ID: Client ID of the OAuth application on the wiki used for account verificationOAUTH_CLIENT_SECRET: Client secret of the OAuth application on the wiki used for account verificationSECRET_KEY: Randomly generated string used for generating verification stateWIKI_REST_API: URL to the rest.php endpoint of the target wiki for verificationTALKTOSTAFF_GROUPS: Object containingserver,utwikianddrwikikeys mapping to role IDs of respective wiki groupsTALKTOSTAFF_CHANNEL: Channel to create private threads for private user-to-staff conversationsTALKTOSTAFF_MUTE_ROLE: Role to give a user if a staff member decides to mute themTALKTOSTAFF_MESSAGE: ID of the message in the talk-to-staff channel which the bot should edit instead of posting anewZEPTOMAIL_AUTH: Secret received from Zeptomail to verify their webhook requestsNOTIFICATION_CHANNEL: Channel ID of the channel where Zeptomail bounces should be sent
These scripts can be run through npm run:
npm start: Starts a development server. You can open a Cloudflare tunnel usingtto obtain a public URL to your bot instance, then set it as the interaction endpoint in your Discord applicationnpm run deploy: Deploys the current code to Cloudflare Workers (production)npm run cf-typegen: Regenerates types inworker-configuration.d.tsnpm run register[-prod]: Registers Discord bot commands so they can be usednpm run post-talktostaff[-prod]: Posts a message with a "talk to staff" buttonnpm run post-verify[-prod]: Posts a message with a verification button
Scripts with a -prod suffix use the .env file for their configuration, whereas the others use the .dev.vars file.