This commit is contained in:
Amazed 2020-09-01 01:25:00 +02:00
parent 6232fc04de
commit 523c739960

View File

@ -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"])