Discord Statistics Bot that monitors user statistics on a server, with the end goal of a personalized User and Server Statistics Experience much like Spotify's Wrapped.
DiscordStat.bot listens on bot-commands
channel only.
BOT_TOKEN
: Discord Bot tokenPSQL_USER
: PSQL Database Connection UsernamePSQL_PSWD
: PSQL Database Connection PasswordPSQL_HOST
: PSQL Database Connection URLPSQL_PORT
: PSQL Database Connection PortPSQL_DB
: PSQL Database Connection Database Name
❗️IMPORTANT❗️: On the first run, make sure the database syncs up by enabling syncing. If you leave sync enabled, you would just get an error logged at the beginning, however functionality will continue to work. This is due to a bug in DenoDB
as of DenoDB Version v1.0.24
.
// First Run
initConnection(env, { debug: false, sync: true });
// other runs
initConnection(env, { debug: false });
Be sure to fill in the .env file before running!
# Copy .env.sample and create your own
cp .env.sample .env
# Runs under Deno :)
deno run --allow-read --allow-write --allow-net --unstable ./src/main.ts
# Can run in a Container using run.sh
./run.sh
All commands should be prefixed with !
.
General Commands
help
: Print the Help Menudonate
: Prints Bot instructions for donatingversion
: Prints Bot's current versioninfo
: Prints bot information
User-Specific Commands
tracking-status
: Prints status of tracking enable/disable for usertracking-set [true/false]
: Sets tracking state given by user argument [true/false]toggle-bot-tracking
: Toggles user being notified of bot's status change. !toggle-bot-tracking [bot-id]list-bot-tracking
: DMs a list for all Bots being tracked to userclear-data
: Clears all stored logs of user. (No Confirmation is given)uptime
: Prints User's most recent uptimeweek-uptime
: Prints User's uptime during the past 7 days
Server-Specific Commands
set-bot-channel
: Sets the Server Channel that the bot should respond to [owner only]show-bot-channel
: Sets the Server Channel that the bot should respond toclear-bot-channel
: Clears the Server Channel that the bot should respond to [owner only]server-interaction
: Prints the current server's user interaction with this bot
Developer-Only Commands Only Developer users in config.json can use these commands
help
: Print dev help menustats-cache
: Prints Cache Statisticsstats-storage
: Prints LocalStorage Statisticsset-bot-status
: Set the bot's current custom statusflush-storage-queue
: Flushes all LocalStorage Queues
Licensed under the MIT License.