diff --git a/README.md b/README.md index b48c9811..3984eb38 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,16 @@ Imgur.token = "1234567890abcde" Steam.web_api_key = "123567890ABCDEF123567890ABCDEF12" # Should Royalnet automatically update the Dota ranks of all users? -Dota.updater = false +Dota.updater.enabled = false + +# How many seconds should there be between two Dota updates? +Dota.updater.delay = 86400 # Should Royalnet automatically update the League of Legends ranks of all users? -Lol.updater = false +Lol.updater.enabled = false + +# How many seconds should there be between two League of Legends updates? +Lol.updater.delay = 86400 # A League of Legends API token (https://developer.riotgames.com/) Lol.token = "RGAPI-aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" @@ -30,7 +36,10 @@ Lol.token = "RGAPI-aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" Lol.region = "euw1" # Should Royalnet automatically update the Brawlhalla ranks of all users? -Brawlhalla.updater = false +Brawlhalla.updater.enabled = false + +# How many seconds should there be between two League of Legends updates? +Brawlhalla.updater.delay = 86400 # A Brawlhalla API key (https://dev.brawlhalla.com/) Brawlhalla.api_key = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA" diff --git a/pyproject.toml b/pyproject.toml index 3cd729ca..ab35fc65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ [tool.poetry] name = "royalpack" - version = "5.9.10" + version = "5.10.0" description = "A Royalnet command pack for the Royal Games community" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" diff --git a/royalpack/commands/brawlhalla.py b/royalpack/commands/brawlhalla.py index 8c8601f1..f83d8b08 100644 --- a/royalpack/commands/brawlhalla.py +++ b/royalpack/commands/brawlhalla.py @@ -25,8 +25,8 @@ class BrawlhallaCommand(Command): def __init__(self, interface: CommandInterface): super().__init__(interface) - if self.interface.name == "telegram" and self.config["Brawlhalla"]["updater"]: - self.loop.create_task(self._updater(7200)) + if self.interface.name == "telegram" and self.config["Brawlhalla"]["updater"]["enabled"]: + self.loop.create_task(self._updater(int(self.config["Brawlhalla"]["updater"]["delay"]))) async def _send(self, message): client = self.serf.client diff --git a/royalpack/commands/dota.py b/royalpack/commands/dota.py index 085fe900..4943e5e0 100644 --- a/royalpack/commands/dota.py +++ b/royalpack/commands/dota.py @@ -24,8 +24,8 @@ class DotaCommand(rc.Command): def __init__(self, interface: rc.CommandInterface): super().__init__(interface) - if self.interface.name == "telegram" and self.config["Dota"]["updater"]: - self.loop.create_task(self._updater(7200)) + if self.interface.name == "telegram" and self.config["Dota"]["updater"]["enabled"]: + self.loop.create_task(self._updater(int(self.config["Dota"]["updater"]["delay"]))) async def _send(self, message): client = self.serf.client diff --git a/royalpack/commands/leagueoflegends.py b/royalpack/commands/leagueoflegends.py index 1331192c..f383a1ee 100644 --- a/royalpack/commands/leagueoflegends.py +++ b/royalpack/commands/leagueoflegends.py @@ -24,9 +24,10 @@ class LeagueoflegendsCommand(rc.Command): def __init__(self, interface: rc.CommandInterface): super().__init__(interface) - self._riotwatcher = riotwatcher.RiotWatcher(api_key=self.config["Lol"]["token"]) - if self.interface.name == "telegram" and self.config["Lol"]["updater"]: - self.loop.create_task(self._updater(7200)) + self._riotwatcher: Optional[riotwatcher.RiotWatcher] = None + if self.interface.name == "telegram" and self.config["Lol"]["updater"]["enabled"]: + self._riotwatcher = riotwatcher.RiotWatcher(api_key=self.config["Lol"]["token"]) + self.loop.create_task(self._updater(int(self.config["Lol"]["updater"]["delay"]))) async def _send(self, message): client = self.serf.client diff --git a/royalpack/version.py b/royalpack/version.py index 9d75da72..1d7bdf7b 100644 --- a/royalpack/version.py +++ b/royalpack/version.py @@ -1 +1 @@ -semantic = "5.9.10" +semantic = "5.10.0"