config | ||
images | ||
includes | ||
install | ||
.gitignore | ||
index.js | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md |
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 fromservers.js
>>server slug
: Show detailed information about a single server including online players, status, and TPS>>restart slug
: If configured, allows players in theRESTART_ROLE
to force-restart a server>>paddle <@member>
: Allows someone in theMOD_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:
-
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