This is the Discord bot for Creation Asylum.
Major credits to jondeaves and gslance for most of the original infrastructure and commands. ❤️
- Run
pnpm installto install dependencies - Copy
.env.local.exampleto.env.localand add the missing values - Run
pnpm devto start in development mode
For VSCode install the following plugins;
You wil also want to use the below configuration in .vscode/settings.json to have Prettier
auto-format code for you.
{
"eslint.packageManager": "pnpm",
"javascript.format.enable": false,
"editor.formatOnSave": true
}At a minimum you need to provide the DISCORD_TOKEN (which can be found on the Bot tab of a Discord
application) and MONGODB_URI values. See .env.local.example for a full list
with more information about each variable.
To add a command you can run the following script:
pnpm gen command my_command_nameYou can deploy on a Linux machine using Docker.
pnpm install-servicesThis will install 2 services on system.d:
venom-bot.service- runs the botvenom-db.service- runs the Mongo database using Docker
They are both set to re-start on failure. You should start them by running:
pnpm db start
pnpm bot startYou can view logs using:
pnpm db logs
pnpm bot logsAny subcommand other than logs is passed directly to system.d with the appropriate service name,
so you can use things like start, stop, restart, enable, disable and so on.
To update the bot from source, simply use:
git pull
pnpm bot restartIMPORTANT: Don't forget to save the MegaHAL brain for the bot before restarting it by sending
!chat saveon any whitelisted channel the bot is on.