2.4.0 • Published 5 months ago

discord-gamestatus v2.4.0

Weekly downloads
80
License
GPL-3.0
Repository
github
Last release
5 months ago

discord-gamestatus

Invite link

Installing

Git, node and npm are required

In future I plan to add install script and update command to make this easier

# Navigate to the directory where you wish to install the bot
git clone https://github.com/Douile/discord-gamestatus.git
cd discord-gamestatus
git checkout latest # Checkout latest stable version
npm install --no-optional # Install dependencies
# If you like you can install optional dependencies but they require node-gyp
# For more info see https://discord.js.org/#/docs/main/12.2.0/general/welcome

Updating

# Navigate to the installed directory
cd discord-gamestatus
# Reset may be needed if you made changes
# git reset --hard latest
git checkout master
git tag -d latest
git pull --ff # This will overwrite local changes, If you wish to save them use git stash
git checkout latest # Checkout latest stable version
git log --name-status HEAD^..HEAD # Check latest commit
npm install --no-optional # Update dependencies (remove --no-optional for optional dependencies, they are faster but need to be compiled)

Commands

At the moment there is no help command

CommandUsagePermissionsComments
help!help [command]NoneList commands / Get help with a specific command
gamelist!gamelist [game]ADMINISTRATORView/Search the list of games available
status!status {game} {ip}ADMINISTRATORAdd a status message to current channel
statusclear!statusclearADMINISTRATORClear all status messages from current channel
statusmod!statusmod [id] [property] [value]ADMINISTRATORModify status messages in the current channel
botinfo!botinfoNonePrint information about current versions, uptime and ping of the bot

Configuring

You can use an environment file set environment variables, this is the recommended way to set API keys Example env file /etc/discord-gamestatus/env (remember to set the file permissions of this file so other users cannot read it: chmod 600 /etc/discord-gamestatus/env, can be owned by root as long as systemd runs as root chown root:root /etc/discord-gamestatus/env)

DISCORD_API_KEY=NjU5.Examplekey
TOPGG_API_KEY=ApiKeyHere

ARGV options

You can configure the bot using argv options for example to change the prefix to $ and enable debug logging you would use:

node . -d --prefix "$"
ArgumentsUsage
-d, --debugEnable debug logging
-v, --verboseEnable verbose logging
--devEnable dev mode (auto restart bot when files are changed)
-p [prefix], --prefix [prefix]Change the bots prefix
--key [key]Set the discord bot API key (overrides the environment variable)
--dbl-key [key]Set the discord bot list key (https://top.gg/)
--owner [snowflake]Set the bot owner
--tick-count [count]Set the number of ticks
--tick-time [time]Set the time between ticks in ms
--channel-limit [limit]The max amount of statuses per channel (0 / not set = infinite)
--guild-limit [limit]The max amount of statuses per guild (0 / not set = infinite)
--allow-duplicate-updatesAllow guilds to have multiple statuses for the same IP
--admin [flag]Set the permission needed to be considered an admin by the bot (see)
--support [link]Set the link to bot support server (shown in botinfo)

Running as service on debian (or other systemd linux)

In order to run on debian I find it easy to run as a service. Steps to setup are as follows.

  1. Create a start script to configure the bot
#!/bin/sh
node --max-old-space-size=300 --title "discord-gamestatus" ./index.js --prefix "_" --owner "293482190031945739"
  1. Allow yourself to run the script chmod +x start.sh (or other script filename)
  2. Create an environment file for API keys See here
  3. (you will need root for this) Create a service in /etc/systemd/service/discord-gamestatus.service (Make sure to replace SCRIPT_LOCATION, USER and CODE_LOCATION with the actual locations)
[Unit]
Description=Discord gamestatus bot
After=network.target
StartLimitBurst=5
StartLimitIntervalSec=5

[Service]
Type=simple
Restart=always
RestartSec=5
User=USER
Group=GROUP
WorkingDirectory=CODE_LOCATION
EnvironmentFile=/etc/discord-gamestatus/env
ExecStart=/bin/sh SCRIPT_LOCATION

[Install]
WantedBy=multi-user.target
  1. You can now start the bot with sudo systemctl start discord-gamestatus, to enable the bot on restart use sudo systemctl enable discord-gamestatus. To check the status use systemctl status discord-gamestatus or for a live log use journalctl -f -u discord-gamestatus.
2.3.0

6 months ago

2.4.0

5 months ago

1.14.3

3 years ago

1.14.2

3 years ago

1.14.1

3 years ago

1.14.0

3 years ago

1.13.2

3 years ago

1.13.1

3 years ago

1.13.0

3 years ago

1.12.6

3 years ago

1.12.5

3 years ago

1.12.4

3 years ago

1.12.3

3 years ago

1.12.2

3 years ago

1.11.6

3 years ago

1.11.5

3 years ago

1.11.4

3 years ago

1.11.3

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

1.11.0

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.2

4 years ago