From 523c7399607eefabb25de02dcd3a7a2248b52d12 Mon Sep 17 00:00:00 2001 From: Hipstercat Date: Tue, 1 Sep 2020 01:25:00 +0200 Subject: [PATCH] logs --- cogs/wynncraft/wynncraftcog.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cogs/wynncraft/wynncraftcog.py b/cogs/wynncraft/wynncraftcog.py index aba093e..cd69648 100644 --- a/cogs/wynncraft/wynncraftcog.py +++ b/cogs/wynncraft/wynncraftcog.py @@ -141,11 +141,14 @@ class WynncraftCog(commands.Cog): max_combat_lvl_class = cl if r["data"][0]["meta"]["location"]["online"] == "true": + await self._log("%s is online" % member_name) online_players.append(r) + else: + await self._log("%s was offline: %s" % (member_name, r["data"][0]["meta"]["location"])) - await self._log("Setting max_combat_lvl_class role") + await self._log("Setting roles") # set max_combat_lvl_class role - discord_member = discord.utils.find(lambda m: m.display_name == member_name, guild.members) + discord_member = discord.utils.find(lambda m: m.display_name.lower() == member_name.lower(), guild.members) if max_combat_lvl_class and discord_member: await self._log("max_combat_lvl_class and discord_member True") @@ -193,6 +196,7 @@ class WynncraftCog(commands.Cog): await self._log("max_combat_lvl_class: %s, discord_member: %s (name: %s)" % (max_combat_lvl_class, discord_member, member_name)) # update online players + await self._log("Updating online list") full_text = "" for online_player in online_players: s = ":green_circle: **%s** connecté sur %s" % (online_player["data"][0]["username"], online_player["data"][0]["meta"]["location"]["server"])