A simple Discord bot for the CircleCraft community to provide server information and other helpful, relevant info.
Go to file
2024-12-14 11:04:01 -05:00
config Add ONLINE_CHECK config option 2024-11-23 18:10:55 +00:00
images Add the >>paddle command 2020-05-06 15:11:54 -04:00
includes Fix path to config.js 2024-11-22 20:32:51 +00:00
install Change from npm to node to start the bot 2024-11-23 18:51:57 +00:00
.gitignore First push of code to the repo 2020-04-03 12:47:15 -04:00
index.js Add config option to enable/disable command parsing. Useful for presence/ingamechat bot instances. 2024-11-23 15:40:42 +00:00
LICENSE Initial commit 2020-04-03 12:44:59 -04:00
package-lock.json Update npms package 2024-12-14 11:04:01 -05:00
package.json Upgrade to Discord API v14 2024-11-22 14:05:20 +00:00
README.md Update README 2024-11-23 20:51:09 +00:00

CircleBot

A simple Discord bot for the CircleCraft community to provide server information and other helpful, relevant info.

Bot use cases:

  • Total player count in bot presence string (below bot name in member list) and in-game chat bot
  • Commands bot

Total Player Count Presence

When config value PRESENCE_INTERVAL: is greater than zero the bot will periodically update the member list bot presence string with the total player count across all configured servers. This is typically the way to set the bot up when also using the same bot as a Discord Integration in-game chat bot from the server (i.e. both this bot and the client mod use the same bot credentials).

  • Set PRESENCE_INTERVAL: to a value greater than zero
  • Set ALLOW_COMMANDS: to false (don't want multiple bots responding to commands
  • Set ALLOW_RESTART: to false (this is relevant only to CircleCraft hosted servers)
  • In this mode no channels are used so these values can be left at the default value
    • CHANNELS_ALLOW
    • MOD_ROLE
    • STAFF_ROLE
    • RESTART_ROLE

Commands bot

When the config value ALLOW_COMMANDS is true it will respond to the following commands:

  • >>online : List all players on all configured servers
  • >>servers : List all the currently active servers from servers.js
  • >>server slug : Show detailed information about a single server including online players, status, and TPS
  • >>restart slug : If configured, allows players in the RESTART_ROLE to force-restart a server
  • >>paddle <@member> : Allows someone in the MOD_ROLE to "paddle" a user for doing something bad (just a joke thing)

Setup

This assumes you have a bot application already created in your discord account and have added that application to your guild/server.

Handy Links:

  • My Discord Applications

  • Add Application to Guild (Step 2)

  • Clone the bot code

  • From the top level folder

    • npm install (some warnings are fine)
  • In the config/ folder:

    • cp config-dist.js config.js
    • edit the config.js with appropriate values
    • cp servers-dist.js servers.js
    • edit the servers.js with one or more servers (depending on bot mode
  • From the root folder: npm start to test

  • Once testing yields successful results:

    • sudo cp install/bot-server.service /etc/systemd/system/bot-yourserver.service
    • Edit /etc/systemd/system/bot-yourserver.service with appropriate values
    • sudo systemctl daemon-reload
    • sudo systemctl enable bot-yourserver.service
    • sudo systemctl start bot-yourserver.service