StephanAkkerman / axie-manager-bot

The self-hosted Discord bot we are using in the Axie Manager server. It consists of multiple handy features for managing your scholars in Axie Infinity and being able to use it for multiple managers.
https://www.instagram.com/axie_manager/
MIT License
5 stars 3 forks source link
axie axie-infinity crypto cryptocurrency discord discord-bot discord-py nft nfts

Axie Manager Bot

Python 3.8 Code style: black MIT License


This is a Discord bot written in Python, with the purpose of helping our guild manage the scholars in our Discord server. The purpose of this bot is that it can be used for guilds with multiple scholars and different managers, who each have their own scholars and wallets.

Important

To run this bot you need to host it yourself, meaning that you should have something that functions as a server. I use my Raspberry PI for this, but there are many other options available for hosting a Discord bot, such as virtual private servers provided by Google, Amazon, Microsoft, and more.

Features

This bot was made with configurability in mind, meaning that every feature listed below can be turned on or off, and be changed easily. If you do not want a feature, just turn it off, all automation and listeners works for your custom roles and channels, so be sure to check out the settings in config_example.yaml and change them to your liking!

Commands

Automation

In config_example.yaml this is also called 'Loops', you can customize each channel that these automated messages will get send in.

Listeners

This section is about the other type of automation, which is based on events.

Tryouts

Tryouts are used to select a new scholar from a group of people (with the role 'tryout'). For each account that is available for a new scholar a new tryout group can be made, it is also possible to make less groups and pick the first and second best players. Currently we let every tryout play for 3 hours on the account and after all tryouts are done the best will be picked. This is done by selecting the tryout that had the best winrate. At the moment the API for that is offline, so after a tryout is done they should send screenshots of their match history.

Disclaimer

The code for the !qr command was inspired by ZracheSs | xyZ, check out their repo for the original code.

Dependencies

The required packages to run this code can be found in the requirements.txt file. To run this file, execute the following code block:

$ pip install -r requirements.txt 

Alternatively, you can install the required packages manually like this:

$ pip install <package>

Setup

Making a Discord bot

This part is about creating the Discord bot, setting up the basics, and inviting it to your server. For the first part you can watch this video (watch until 2:20).

Or follow these written instructions:

Then you need to add the custom emojis to the server (can be skipped).

Last you need to fill in the important information in config_example.yaml, so the bot knows which server it should be connected to.

Spreadsheet

This part needs to be done and is a bit technical, so follow the steps carefully. Or follow the instructions from this (starts from 1:58) video

If you prefer written instructions follow the instructions below:

After follow the instructions above, last things you need to do is this:

Make the roles, channels, and spreadsheets

Because no one likes to go through the process of making all the new channels, roles, and spreadsheets themselves I have written a script to do it for you. To run it you need to have followed the steps above, so you should have installed the dependencies, made the bot, and gave it access to your preferred Google Drive folder. If you have done all that you can execute the following code:

$ python src/setup.py

This will also rename config_example.yaml to just config.yaml so you do not need to worry about renaming that as well. The result will look like this: setup So as the last step for the setup you need to copy your Fernet key to config.yaml line 107, and after that is done you are ready for deploying the bot.

Scholars

As you might have noticed the bot created a spreadsheet called Scholars. This spreadsheet functions as a database of your scholars. You can fill the values in by using the !scholar <scholar_discord_name> <address> <split> <payout_address> <encrypted_key> <[manager]> command or by adding it manually to the sheet. The picture below shows how the values should look like. scholars

Alerts

As you might have noticed the bot also created a spreadsheet called Axie Alerts. This spreadsheet specifies the Axies that should be alerted in the server, for instance if they have a low price or good genes. Below an example is shown of how you can fill in this spreadsheet. builds

Example of an alert that the bot automatically sends:\ alert

How to run