The discord bot will run in your local machine. You can deploy this bot in AWS if you want.
/balance
shows the balance of the account. This command accepts one argument the teamId
of the scholar team.
/battles-stats
returns a summary of the last 100 battles played by the scholar.
/add-scholar
adds a scholar to the bot database. This command accepts three arguments:
-
Discord user: the scholar discord user. Required.
-
Full Name: the name of your scholar. Required.
-
Payout Address: is where the scholar receives their payouts. Leave it blank if you don't already have this information. Optional.
/add-team
adds a team to the bot database. This command accepts three arguments:
-
Team ID: the team id of the account (account number) it cannot be repeated. Required.
-
Ronin address: your team ronin address. Required.
-
Daily fee: can be a percentage (example: 0.5 is 50%) or it can be a static number charged daily (example: 30 SLP). Required.
/assign-team
assign a team to scholar. This command accepts two arguments:
-
Team ID: the team that will be assigned. Required.
-
Discord user: scholar who will play with this team. Required.
/get-battles
get the summary of the last 100 battles of one scholar. This command accepts only one argument:
- Discord user: the scholar whose battles will be shown. Required
/get-scholar
get the information of one scholar. This command only accepts one argument:
- Discord user: the scholar whose information will be shown. Required
/payout
get all the scholars who are ready to payout.
/remove-scholar
kicks scholar from the discord server and removes from the database. This command only accepts one argument:
- Discord user: the scholar who will be deleted and kicked. Required
/remove-team
kicks scholar from the discord server and removes from the database. This command only accepts one argument:
- Team ID: the account number to delete. Required
/summary
shows the summary of your scholarship.
top-3
shows the best top 3 of your scholarship order by MMR.
/update-free-days
Assign free days to a team if this team is charged a daily fee. This command accepts two arguments:
-
Team ID: the account number to add the days without daily fee. Required
-
Free days: the ammount of days. Required
/update-scholar-address
updates the payout address of one scholar. This command accepts two arguments:
-
Discord User: the scholar who payout address will be changed. Required
-
Payout address: the new payout address. Required
/update-scholarship
updates the database with the game information of each scholar.
I recommend to run this command before run /summary
command because this ensures that the database has the latest information from the Axie Servers.
/update-team-fee
updates fee of one team. This command accepts two arguments:
-
Team ID: the account number to update the daily fee. Required
-
Daily fee: can be a percentage (example: 0.5 is 50%) or it can be a static number charged daily (example: 30 SLP). Required.
- Download NodeJS from the official website: https://nodejs.org/es/download/. Install the LTS version.
- Download Git for windows from the official website: https://gitforwindows.org/. Follow the steps to install git.
- Open your Ubuntu command line (or distribution of your choice).
- Install cURL (a tool used for downloading content from the internet in the command-line) with: sudo
apt-get install curl
- Install nvm, with:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
- To verify installation, enter:
command -v nvm
...this should return 'nvm', if you receive 'command not found' or no response at all, close your current terminal, reopen it, and try again. - Install the current stable LTS release of Node.js (recommended for production applications):
nvm install --lts
.
For the latest stable Git version in Ubuntu/Debian, enter the command:
sudo apt-get install git
In your terminal opened to the folder you want to install the bot to, run the following command:
git clone https://github.com/gabitodev/gabitodev-bot.git
Enter yes and wait for the download to end. Leave your terminal open and follow the following steps.
-
Navigate to the Discord developer portal website and login with your main Discord account: https://discord.com/developers/applications.
-
Click the New Application button at the top right:
-
Name your bot and click Create. This should be named after your scholarship program.
-
Go to the Bot section on the left-side menu:
-
In the bot section click the Add Bot button:
-
Name your bot and proceed to reset the bot token:
-
As soon you click reset token you need to copy the new generated token and save it for now in notepad. You will need this for later.
-
Go to the OAuth2 page from the left menu:
-
Copy your client ID and save it in your notepad:
-
Click on the URL Generator and select the bot and applications.commands scopes. The first gives the account bot privileges and the second allows for slash commands.
-
Select all the permissions the bot needs to run, shown below:
-
Copy the bottom URL and paste it in the browser of your preference. This will bring you to a Discord menu to select which server to add your bot to. Only servers you have permissions to add bots on will be displayed. Select your server and confirm.
Now the bot is in your discord sever but at the moment it doesn't work. We need to setup the code for the bot first.
First, you will need to fill out your env file. The bot comes with an example.env file. Rename to env.
You will need to add your bot token, the client ID for the bot, the scholar role ID of your scholars in your discord server and the guild ID of your server (ID of your discord server).
See the example.env
file for more information.
In your terminal where you bot was downloaded, run the followind command:
npm install
If the process fail, try again. This will install all of the necessary dependencies to run the bot.
Run the following command: npm run create-tables
.
This structures the database to work with the bot.
Make sure that you already create the tables for the database.
If you have a large Scholarship progam, you may want to import the data in advance rather then add each scholar and team one by one. You will need to make a CSV file where you put all the information. Follow this format:
For scholars:
discordId
the scholar discord id, you can get this directly from discord. If you dont know how to get this Google is yours best friend. Required.
fullName
the name of your scholar. Required.
payoutAddress
is where the scholar receives their payouts. Leave it blank if you don't already have this information. Optional.
For teams:
teamId
the team id of the account (account number) it cannot be repeated. Required.
roninAddress
your team ronin address. Required.
daily fee
can be a percentage (example: 0.5 is 50%) or it can be a static number charged daily (example: 30 SLP). Optional.
renterDiscordId
the scholar discord id who plays with this team. You can add this information later. Optional.
Download this two CSV files and paste it inside the database folder where you downloaded the bot.
Now run in your terminal the following command: npm run import-tables
.
This will create the database with the data that you supplied.
If you want to delete your database simply delete the db file in your bot folder or rerun the npm run import-tables
command.
Now that we have all set run in your terminal the following command to put the bot online:
npm run start
This will launch the bot and now you and your scholars can use it in your discord server.