Exemplo n.º 1
0
    def __init__(self, bot):
        self.bot = bot

        self.db = self.bot.get_cog("Database")

        self.hypixel = aiopypixel.Client(self.bot.hypixel_key)

        self.session = aiohttp.ClientSession()

        self.failed = 0
        self.failed_sloth = 0
        self.failed_mojang = 0

        self.do_clear = True

        self.valid_names_and_uuids = []
        self.name_uuid_cache = {}  # {name: uuid}
        self.uuid_name_cache = {}  # {uuid: name}
        self.player_friends_cache = {}  # {uuid: [friends...]}
        self.player_guild_cache = {}  # {uuid: guild}
        self.guild_id_name_cache = {}  # {id: name or name: id}
        self.player_object_cache = {}  # {uuid: Player}
        self.guild_cache = {}  # {id: Guild}
        self.armor_cache = {}  # {uuid: armor_str}
        self.skyblock_cache = {}  # {profile_str: data}
        self.watchdog_cached = None
        self.achievement_pts_cache = {
        }  # {username: achievement_points: int, }

        self.stop_loops = False

        self.bot.loop.create_task(self.reset_continuous())
        self.bot.loop.create_task(self.reset_5_minutes())
        self.bot.loop.create_task(self.reset_1_hour())
        self.bot.loop.create_task(self.reset_2_hours())
        self.bot.loop.create_task(self.reset_6_hours())
Exemplo n.º 2
0
async def getGuildData():
    client = aiopypixel.Client(api_key)
    await client.getGuildName("Iapetus11")
    await client.close()
Exemplo n.º 3
0
async def getGameCounts():
    client = aiopypixel.Client(api_key)
    await client.getGameCounts()
    await client.close()
Exemplo n.º 4
0
async def getGuildName():
    client = aiopypixel.Client(api_key)
    await client.getGuildName("TrustedMercury")
    await client.close()
Exemplo n.º 5
0
async def getKeyData():
    client = aiopypixel.Client(api_key)
    await client.getKeyData()
    await client.close()
Exemplo n.º 6
0
async def rank():
    client = aiopypixel.Client(api_key)
    print(await client.getRank("Iapetus11"))
    await client.close()
Exemplo n.º 7
0
async def test_get_friends():
    client = aiopypixel.Client(api_key)
    print(await client.getPlayerFriends("TrustedMercury"))
    await client.close()
Exemplo n.º 8
0
async def leaderboard():
    client = aiopypixel.Client(api_key)
    print(await client.getLeaderboard())
    await client.close()