kaogeek/kaogeek-discord-bot
À propos
Discord bot for KaoGeek, built with TypeScript
Autres projetsProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalKao.Geek bot
Discord bot for KaoGeek, built with TypeScript and discord.js
Workspace Setup
Make sure to use same node version as specified in
.nvmrcby using nvmnvm useIf not installed, use
nvm installto install specified version in.nvmrc(at the time of writinglts/hydrogen)Enable Corepack (if not yet), this will automatically install
pnpmwith the version specified inpackage.json#packageManager.corepack enableThis will ensure all developers use the same version of
pnpm. Corepack will automatically switch pnpm's version when you switch to different workspace.Install dependencies
pnpm install
Discord Bot & Server Setup (For Development)
Open Discord app, create your own Discord server for bot development
Right click at your server's icon, copy server ID (This will be
GUILD_IDin your.env)Right clict at your text channel, copy channel ID (This will be
MOD_CHANNEL_IDin your.env)Go to Discord Developer Portal and create a new application, name it whatever you want
Go to your application's
Bottab get the bot's token by clickingReset Tokenbutton, copy the token and keep it save, don't share this to anyone! (This will beBOT_TOKENin your.env)In the same window under the
Privileged Gateway Intentssection, enablePRESENCE INTENT,SERVER MEMBERS INTENT, andMESSAGE CONTENT INTENT- You can set to
Go to
OAuth2->URL Generatortab, selectbotandapplications.commandsscopes, then select permissions underBot Permissionssection, copy the generated URL and paste it in your browser, then choose your server to add the bot.Administratorfor ease of development, but it's not recommended for production.
Development
Copy the
.env.exampleto.envcp .env.example .envThen, set all variables in
.envfileENV Variables
BOT_TOKENDiscord bot tokenGUILD_IDDiscord server IDMESSAGE_COOLDOWN_SECcooldown to push the sticky message to the bottom of channelMESSAGE_MAXthe maximum message before push sticky message to the bottom of channelMOD_CHANNEL_IDDiscord channel ID for bot to report moderation actionsDATABASE_URLPrisma database URL, you can use SQLite for development, set it tofile:./dev.db
To run the bot in development mode
pnpm devOr run the bot in watch mode with automatic rerun on changes
pnpm dev:watch
Production deployment
The production instance of the Discord bot is hosted by Yue.sh. To deploy to production, trigger the Deployment workflow on GitHub Actions.
Log from the production bot is sent to Papertrail. If you have access to Papertrail, you can view the logs at https://my.papertrailapp.com/systems/kaogeek/events
Running
- Run with Docker
docker build -t kaogeek-discord-bot . docker run -d --env-file=.env --name kaogeek-discord-bot kaogeek-discord-bot - Run with Node
pnpm install pnpm build pnpm start
Explorer des projets similaires
Chargement…