Giter Site home page Giter Site logo

stephanakkerman / axie-manager-bot Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 3.0 1.37 MB

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.

Home Page: https://www.instagram.com/axie_manager/

License: MIT License

Python 100.00%
axie axie-infinity crypto cryptocurrency discord discord-bot discord-py nft nfts

axie-manager-bot's Issues

Implement extensive error handling

Add different error messages for different errors. Useful for users but also debugging

  • Send important errors to new bot-errors channel
  • encrypt.py
  • help.py
  • listeners.py
  • manage_server.py
  • miscellaneous.py
  • qr.py
  • leaderboard.py
  • scholar_data.py
  • DMChannel

Optimize get_genes() calling

Does not need to happen if the axie has already been seen, in new listings dismiss axie ids that have already been seen

Implement our own !mute

  • !mute <user> gives a user the "mute" role
  • !unmute <user> takes the "mute" role away
  • Command is only allowed to be used by managers

Fix random error messages in alert.py

  • Traceback (most recent call last):
    File "/home/pi/src/cogs/after/alert.py", line 203, in new_listings
    search, build["R1 deviation"], build["R2 deviation"]
    File "/home/pi/src/alerts/genes.py", line 26, in get_genes
    genes = pd.DataFrame(response)
    File "/home/pi/venv/lib/python3.7/site-packages/pandas/core/frame.py", line 614, in init
    mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
    File "/home/pi/venv/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 465, in dict_to_mgr
    arrays, data_names, index, columns, dtype=dtype, typ=typ, consolidate=copy
    File "/home/pi/venv/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 119, in arrays_to_mgr
    index = _extract_index(arrays)
    File "/home/pi/venv/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 635, in _extract_index
    raise ValueError("All arrays must be of the same length")
    ValueError: All arrays must be of the same length

  • 'NoneType' object is not subscriptable
    Traceback (most recent call last):
    File "/home/pi/src/cogs/after/alert.py", line 314, in old_listings
    build,
    File "/home/pi/src/cogs/after/alert.py", line 90, in send_alert
    if "auction_info" in row.index
    TypeError: 'NoneType' object is not subscriptable

  • 'float' object is not subscriptable
    Traceback (most recent call last):
    File "C:\Users\Tim\Documents\GitHub Public Repos\Axie_Manager_Bot\src\cogs\after\alert.py", line 310, in old_listings
    await get_genes(
    File "C:\Users\Tim\Documents\GitHub Public Repos\Axie_Manager_Bot\src\alerts\genes.py", line 30, in get_genes
    genes[part] = genes["traits"].apply(lambda x: x[part])
    File "D:\Anaconda3\lib\site-packages\pandas\core\series.py", line 4357, in apply
    return SeriesApply(self, func, convert_dtype, args, kwargs).apply()
    File "D:\Anaconda3\lib\site-packages\pandas\core\apply.py", line 1043, in apply
    return self.apply_standard()
    File "D:\Anaconda3\lib\site-packages\pandas\core\apply.py", line 1098, in apply_standard
    mapped = lib.map_infer(
    File "pandas_libs\lib.pyx", line 2859, in pandas._libs.lib.map_infer
    File "C:\Users\Tim\Documents\GitHub Public Repos\Axie_Manager_Bot\src\alerts\genes.py", line 30, in
    genes[part] = genes["traits"].apply(lambda x: x[part])
    TypeError: 'float' object is not subscriptable

Bug for new listings where 'traits' is not in API response

Traceback (most recent call last):
File "/home/pi/src/cogs/after/alert.py", line 243, in new_listings
search, build["R1 deviation"], build["R2 deviation"]
File "/home/pi/src/alerts/genes.py", line 43, in get_genes
genes[part] = genes["traits"].apply(lambda x: x[part])
File "/home/pi/venv/lib/python3.7/site-packages/pandas/core/frame.py", line 3024, in getitem
indexer = self.columns.get_loc(key)
File "/home/pi/venv/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 3082, in get_loc
raise KeyError(key) from err
KeyError: 'traits'

Verification

Provide automatic verification using a button and embed message

Implement our own !clear

  • !clear <amount> clears a certain amount of messages
  • !clear <amount> [user] clears a certain amount of messages from a user
  • should only be allowed to be run by managers

Add scholar as command

usage !scholar <new scholar> <split> <manager>

  • Create spreadsheet with overview of all scholars
  • Ask for confirmation
  • Add verified user as new scholar
  • Add manager name as role to scholar
  • Send message to manager(s) that they are now managing the new scholar
  • Send message to scholar that they are now scholar of manager x
  • Automatically add user to spreadsheet with filled in info
  • #45
  • Error handling

Example:
img

Update the file structure

Change files such that main.py is much cleaner. Functions should be in their respective .py files.

Upgrade announcements

  • Add timestamp
  • Remove all messages except for confirmation template and command call

Change docstrings to better represent commands

Format the command docstrings such that we have a better description of what the command does and the usage.

E.g.

""" General description of command

    [More in-depth description]
    <parameter one>: does x
    [parameter two]: can be used to enhance y
"""

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.