From 8b9de800d4eb5fcc37d91d9b38d6ca672d27115a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 28 Apr 2020 20:03:22 +0200 Subject: [PATCH] Make updaters optional --- royalpack/commands/brawlhalla.py | 5 +---- royalpack/commands/dota.py | 2 +- royalpack/commands/leagueoflegends.py | 2 +- royalpack/commands/matchmaking.py | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/royalpack/commands/brawlhalla.py b/royalpack/commands/brawlhalla.py index 77855951..714b9c01 100644 --- a/royalpack/commands/brawlhalla.py +++ b/royalpack/commands/brawlhalla.py @@ -24,7 +24,7 @@ class BrawlhallaCommand(Command): def __init__(self, interface: CommandInterface): super().__init__(interface) - if self.interface.name == "telegram": + if self.interface.name == "telegram" and self.config["Brawlhalla"]["updater"]: self.loop.create_task(self._updater(7200)) async def _send(self, message): @@ -44,13 +44,10 @@ class BrawlhallaCommand(Command): string.append(f"[b]{bh.rank_1v1}[/b] ({bh.rating_1v1} MMR)") string.append("") - duos = bh.duos - if len(bh.duos) != 0: string.append(f"👥 [b]2v2[/b]") for duo in bh.duos: - other = duo.other(bh) string.append(f"Con [b]{other.steam.user}[/b]: [b]{duo.rank_2v2}[/b] ({duo.rating_2v2} MMR)") diff --git a/royalpack/commands/dota.py b/royalpack/commands/dota.py index a640e327..e1f3c7dc 100644 --- a/royalpack/commands/dota.py +++ b/royalpack/commands/dota.py @@ -23,7 +23,7 @@ class DotaCommand(Command): def __init__(self, interface: CommandInterface): super().__init__(interface) - if self.interface.name == "telegram": + if self.interface.name == "telegram" and self.config["Dota"]["updater"]: self.loop.create_task(self._updater(7200)) async def _send(self, message): diff --git a/royalpack/commands/leagueoflegends.py b/royalpack/commands/leagueoflegends.py index 2c583956..493289ab 100644 --- a/royalpack/commands/leagueoflegends.py +++ b/royalpack/commands/leagueoflegends.py @@ -24,7 +24,7 @@ class LeagueoflegendsCommand(Command): def __init__(self, interface: CommandInterface): super().__init__(interface) self._riotwatcher = riotwatcher.RiotWatcher(api_key=self.config["Lol"]["token"]) - if self.interface.name == "telegram": + if self.interface.name == "telegram" and self.config["Lol"]["updater"]: self.loop.create_task(self._updater(7200)) async def _send(self, message): diff --git a/royalpack/commands/matchmaking.py b/royalpack/commands/matchmaking.py index ddfc6de4..fbe080fd 100644 --- a/royalpack/commands/matchmaking.py +++ b/royalpack/commands/matchmaking.py @@ -109,7 +109,7 @@ class MatchmakingCommand(Command): callback_data=f"mm{mmevent.mmid}_LATE_SHORT"), InKB(f"{MMChoice.LATE_MEDIUM.value} 30 min", callback_data=f"mm{mmevent.mmid}_LATE_MEDIUM"), - InKB(f"{MMChoice.LATE_LONG.value} 60 min", + InKB(f"{MMChoice.LATE_LONG.value} 60+ min", callback_data=f"mm{mmevent.mmid}_LATE_LONG"), ], [