Modular Discord Bot is a Discord bot that provides multiple modules, each with its own functionality.
You will need to install Node Version Manager (NVM), a tool for managing multiple Node.js versions.
sudo apt install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrcVerify that nvm is correctly installed.
nvm list-remoteInstall Node.js version 16.11.0 or above. You can list all available versions with: nvm list-remote
nvm install 24.11.1
nvm use 24.11.1 # Activate the version
nvm alias default 24.11.1 # Set it as the default versionClone the repository and install dependencies:
npm installIn the base module config, create a secretConfig.json file with the following structure:
{
"token": "your-token",
"webhookURL": "your-webhook",
"clientId": "your-client-id"
}You can find your token and client ID here: Discord Developer Portal.
If you want to use all modules :
node ./index.js--help,-h
Display help information--modules,-m<module_name>
Load specific modules, separated by,(e.g.-m roll_dice,jukebox). Default : all modules-list-modules,-l
List all available modules
To keep the bot running after a reboot (e.g. on a VM), you can use the process manager pm2:
npm install pm2@latest -gStart the bot:
pm2 start ./Discord_Modular_Bot/index.js --name "Discord Modular Bot" # --name is optional but helps track the processEnable automatic restart on system boot:
pm2 startup
# You will be asked to execute a command, then:
pm2 save