tops bot for discord
Discord bot to make any top, sorted from highest to lowest score
I mean, it's a weird concept that might not be useful at all, but I learned Redis whilst making it so that's what counts!
The bot has it's own DataBase, yes you guessed it right, a Redis database, so you must install a Redis server first
Installing Redis server
If you are a Windows user, consider reading this guide, for Ubuntu users you can check this other one
If your OS doesn't match any of the other two, there are tons of guides around the internet!
Now that we have our Redis server installed, let's install the dependencies
Installing dependencies
On your root directory run
npm install
Now let's set the enviroment variables, let's set up our .env , first by creating it
Setting up .env
Create your .env file, for Linux distros use
touch .env
For Windows command line:
type NUL > .env
On this file add the following template:
TOKEN=
REDIS_PASS=
REDIS_IP=
PREFIX=
For "TOKEN" field add your Discord bot Token, for "REDIS_PASS" add the Redis password in case there is any, at "REDIS_IP" you must place the IP addres where your Redis server is at, if it's locally, use 127.0.0.1, on "PREFIX" you may set the prefix the bot will recognize, if there's nothing there it'll be "!" The Redis Port the client will attempt to connect to is 6390 , you can change it by modifying /connector.js file
Running the bot
Now that everything is set up, let's run our bot by typing in the root directory
node index.js
This bot can work alongside a CRUD REST API, you can find it here By now, you must generate the tokens manually and add them to a HASH called "tokens" in which each Key (the token) must have the Server ID as it's Value
|__tokens (Hash Name)
|__token (Key must be the token)
|__serverID (Value must be the Server ID attached to that token)
Any kind of addition/help/PR is highly welcomed <3
Current contributors:
Serafin - They made the most part at /commands while doing it they challenged themselves to use the lesser if and else statements as possible
This bot uses DiscordJS12 and Node Redis as their main dependencies