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_WEBHOOK: Webhook URL of the webhook which posts 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 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 verificationZEPTOMAIL_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 atlocalhost:8787- You might want to install ngrok and run
ngrok http 8787to obtain a public IP, then set your public URL as the interaction endpoint in your Discord application
- You might want to install ngrok and run
npm 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[-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.