Discord bot for KaoGeek, built with TypeScript and discord.js
-
Make sure to use same node version as specified in
.nvmrc
by using nvmnvm use
If not installed, use
nvm install
to install specified version in.nvmrc
(at the time of writinglts/hydrogen
) -
Install dependencies
pnpm install
-
Go to Discord Developer Portal and create a new application, name it whatever you want
-
You can set to
Go to
OAuth2
->URL Generator
tab, selectbot
andapplications.commands
scopes, then select permissions underBot Permissions
section, copy the generated URL and paste it in your browser, then choose your server to add the bot.Administrator
for ease of development, but it's not recommended for production.
-
Copy the
.env.example
to.env
cp .env.example .env
-
Then, set all variables in
.env
fileENV Variables
BOT_TOKEN
Discord bot tokenGUILD_ID
Discord server IDMOD_CHANNEL_ID
Discord channel ID for bot to report moderation actionsDATABASE_URL
Prisma database URL, you can use SQLite for development, set it tofile:./dev.db
-
To run the bot in development mode
pnpm dev
- 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