Bartor / discord-stats-bot

The premium version is now out and you can modify all the channel names to your liking! Join Support Server for more info and to see it work.

Do you want to see the amount of people in your server at all times? Here is the solution. The bot is able to track Total Users, Bot Users and Human Users and it does this by updating the name of a voice channel at the top of your server. The bot has an automatic setup which creates all necessary channels needed for function. You can modify exactly what stats you track aswell. You can also set join/leave messages aswell which will all be logged into one channel and is easily distinguishable.

Permissions

The bot requires Administrator permissions for it function correctly and move all the channels to the top. Could it not just do it with manage channels? Well discord permissions are messed up and wont allow the bot to move channels with that permission. If there is any issues with the bot or if you require assistance with the bot pm me on discord, Armada#6103.

Settings Commands

COMMAND DESCRIPTION USAGE
-totalusers Toggle the tracking of total users in your server with the use of a voice channel name. -totalusers on
-humanusers Toggle the tracking of human users in your server with the use of a voice channel name. -humanusers on
-botusers Toggle the tracking of bots in your server with the use of a voice channel name. -botusers on

Setup Commands

COMMAND DESCRIPTION USAGE
-setup Get the bot to setup all the necessary channels for it to work. -setup
-log Toggle the tracking of member joins/leaves in your server with the use of message embeds. -log on

Misc Commands

COMMAND DESCRIPTION USAGE
-update Force update all the channels to the correct amounts. -update
-ping Get a rough measure of latency for the bot. More for seeing if the bot is alive. -ping
-info Get some info about the bot. -info
-config Shows the current configuration for your server. -config
-invite Get a direct invite link for the bot so you can give it to your friends or invite it to their servers. -invite

Realm Royale Stats | Current Feature List

Account Linking

  • !rr link
    — Link your Discord account to your Realm account.
  • !rr unlink
    — Unlink your Discord account from the currently linked Realm account.

Player Statistics

  • All stats are printed in image form.

  • !rr
    — Get your personal stats.

  • !rr
    — Get another players stats.

  • !rr class
    — Get your stats split by all classes.

  • !rr our stats for a specific class.

  • !rr history
    — Get match stats for your 50 most recent games.

Game Information

  • !rr info
    — Get your account information.
  • !rr patch
    — Returns the current patch information.
  • !realm
    — Link to report a bug or provide game feedback for the developers.
  • !rr status
    — Get the current Realm Royale server status.

Admin Commands

  • !rr prefix
    — Sets prefix for the server. Keep in mind it must be one character!
  • !rr setcc
    — Commands can only be used in this channel.
  • !rr delcc
    — Commands will be blocked in this channel.
  • !rr clearcc
    — All command channels will be cleared.

Bot Commands

  • !rr invite
    — Get an invite link for this bot.
  • !rr vote
    — Support the bot by upvoting it twice each day!
  • !rr bot
    — Get the bots information.

Project focused mainly on database-side of things, uses MySQL, Node.js, Discord.js and MySQL2 connector. Saves logs about messages, deletions, edits, channels, guild, users and more, allows to use customizable commands and own queries to fetch data from the DB.

The project is currently being moved
to Docker and so it doesn’t work that great now. The

docker-compose build --build-arg pass=<
db user password>
 --build-arg token=<
discord bot token>
 app database

should
build the app properly, but running it using docker-compose
is to be done. You can start the whole thing manually if you really wish (for whatever reason) or you can create a pull request and help me to fix the damn thing!

There are several important directories in the repository:

  • init — holds initialization files with init script, init.js
  • config — is created after initialization, holds important, sensitive data
  • main.js — entry point for the app, launches it
  • util — utility modules
  • connectors — modules that interact with the DB directly
  • handerls — responsible for reacting to changes on the tracked guilds
  • messageInterpreter.js — interprets messages and launches commands
  • commands — command files with run(msg)
    function and help
    object

Initialization and backups work only on a server with mysql
and mysqldump
in the PATH
, also init won’t work if the defualt shell doesn’t accept input stream redirection operator < (to be fixed in later updates).

Bot operates by reading all the changes on the guilds, interpreting them and inserting, deleting and updating its database accordingly. It allows to gather statistics much faster than using Discord’s search bar. All currently implemented commands can be accessed via help
and each one is described via help
.

This diagram represents the structure of created database:

Futher specs are defined in specification (polish).

App is currently in alpha-ish state, so the functionality is limited and not everything will work perfectly.

Рейтинг автора
5
Подборку подготовил
Андрей Ульянов
Наш эксперт
Написано статей
168
Ссылка на основную публикацию
Похожие публикации