From 3f2cf1336caa0dea7879ee17b56d396c8b0721c3 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 5 Nov 2019 10:40:18 +0100 Subject: [PATCH] Display the queue in which the rank changed --- royalnet/packs/royal/commands/leagueoflegends.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/royalnet/packs/royal/commands/leagueoflegends.py b/royalnet/packs/royal/commands/leagueoflegends.py index 50f59536..d76f8fbb 100644 --- a/royalnet/packs/royal/commands/leagueoflegends.py +++ b/royalnet/packs/royal/commands/leagueoflegends.py @@ -43,11 +43,20 @@ class LeagueoflegendsCommand(Command): # 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: return + # Find the queue + queue_names = { + "rank_soloq": "Solo/Duo", + "rank_flexq": "Flex", + "rank_twtrq": "3v3", + "rank_tftq": "TFT" + } # Prepare the message 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: - 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 client = self.interface.bot.client await self.interface.bot.safe_api_call(client.send_message,