1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Display the queue in which the rank changed

This commit is contained in:
Steffo 2019-11-05 10:40:18 +01:00
parent 314273c2c0
commit 3f2cf1336c

View file

@ -43,11 +43,20 @@ class LeagueoflegendsCommand(Command):
# Don't send messages for every rank change, send messages just if the TIER or RANK changes! # Don't send messages for every rank change, send messages just if the TIER or RANK changes!
if old_value.tier == new_value.tier and old_value.rank == new_value.rank: if old_value.tier == new_value.tier and old_value.rank == new_value.rank:
return return
# Find the queue
queue_names = {
"rank_soloq": "Solo/Duo",
"rank_flexq": "Flex",
"rank_twtrq": "3v3",
"rank_tftq": "TFT"
}
# Prepare the message # Prepare the message
if new_value > old_value: if new_value > old_value:
message = f"📈 [b]{obj.user}[/b] è salito a {new_value} su League of Legends! Congratulazioni!" message = f"📈 [b]{obj.user}[/b] è salito a {new_value} su League of Legends " \
f"({queue_names[attribute_name]})! Congratulazioni!"
else: else:
message = f"📉 [b]{obj.user}[/b] è sceso a {new_value} su League of Legends." message = f"📉 [b]{obj.user}[/b] è sceso a {new_value} su League of Legends " \
f"({queue_names[attribute_name]})."
# Send the message # Send the message
client = self.interface.bot.client client = self.interface.bot.client
await self.interface.bot.safe_api_call(client.send_message, await self.interface.bot.safe_api_call(client.send_message,