From 074c41f8020e6f9a52542205600036edd3008c53 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Sat, 7 May 2022 01:28:53 -0600 Subject: [PATCH 1/5] Change phishing sync time to 1 hour --- jarvis/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jarvis/client.py b/jarvis/client.py index 65065a8..389f6ca 100644 --- a/jarvis/client.py +++ b/jarvis/client.py @@ -77,11 +77,11 @@ class Jarvis(Client): self.phishing_domains = [] self.pre_run_callback = self._prerun - @Task.create(IntervalTrigger(days=1)) + @Task.create(IntervalTrigger(hours=1)) async def _update_domains(self) -> None: self.logger.debug("Updating phishing domains") async with ClientSession(headers={"X-Identity": "Discord: zevaryx#5779"}) as session: - response = await session.get("https://phish.sinking.yachts/v2/recent/86415") + response = await session.get("https://phish.sinking.yachts/v2/recent/3700") response.raise_for_status() data = await response.json() From 7564c37f1443808feb66c682f947dfa5eabc76ab Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 30 May 2022 22:53:25 -0600 Subject: [PATCH 2/5] Fix updates to use *_extension instead of *_cog --- jarvis/utils/updates.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/jarvis/utils/updates.py b/jarvis/utils/updates.py index 46b6e28..2c1d21b 100644 --- a/jarvis/utils/updates.py +++ b/jarvis/utils/updates.py @@ -151,20 +151,20 @@ async def update(bot: "Client") -> Optional[UpdateResult]: for module in current_commands.keys(): if module not in new_commands: logger.debug("Module %s removed after update", module) - bot.drop_cog(module) + bot.unload_extension(module) unloaded.append(module) logger.debug("Checking for new/modified commands") for module, commands in new_commands.items(): logger.debug("Processing %s", module) if module not in current_commands: - bot.load_cog(module) + bot.load_extension(module) loaded.append(module) elif len(current_commands[module]) != len(commands): try: - bot.reload_cog(module) + bot.reload_extension(module) except ExtensionNotFound: - bot.load_cog(module) + bot.load_extension(module) reloaded.append(module) else: for command in commands: @@ -187,23 +187,23 @@ async def update(bot: "Client") -> Optional[UpdateResult]: # Check if number arguments have changed if len(old_args) != len(new_args): try: - bot.reload_cog(module) + bot.reload_extension(module) except ExtensionNotFound: - bot.load_cog(module) + bot.load_extension(module) reloaded.append(module) elif any(x not in old_arg_names for x in new_arg_names) or any( x not in new_arg_names for x in old_arg_names ): try: - bot.reload_cog(module) + bot.reload_extension(module) except ExtensionNotFound: - bot.load_cog(module) + bot.load_extension(module) reloaded.append(module) elif any(new_args[idx].type != x.type for idx, x in enumerate(old_args)): try: - bot.reload_cog(module) + bot.reload_extension(module) except ExtensionNotFound: - bot.load_cog(module) + bot.load_extension(module) reloaded.append(module) return UpdateResult( From c812ced2194e37973d716fae673166bfa1545a12 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 7 Jun 2022 14:13:10 -0600 Subject: [PATCH 3/5] Fix dbrand API changes --- jarvis/cogs/dbrand.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jarvis/cogs/dbrand.py b/jarvis/cogs/dbrand.py index c9e34d5..385db4c 100644 --- a/jarvis/cogs/dbrand.py +++ b/jarvis/cogs/dbrand.py @@ -127,7 +127,7 @@ class DbrandCog(Extension): fields = None if data is not None and data["is_valid"] and data["shipping_available"]: fields = [] - fields.append(EmbedField(data["short-name"], data["time-title"])) + fields.append(EmbedField(data["tier-title"], data["time-title"])) for service in data["shipping_services_available"][1:]: service_data = await self._session.get(self.api_url + dest + "/" + service["url"]) if service_data.status > 400: @@ -135,7 +135,7 @@ class DbrandCog(Extension): service_data = await service_data.json() fields.append( EmbedField( - service_data["short-name"], + service_data["tier-title"], service_data["time-title"], ) ) From 251c1207318d80d55960860903ec4f941b513bb6 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 7 Jun 2022 14:18:55 -0600 Subject: [PATCH 4/5] Fix embed information --- jarvis/cogs/dbrand.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarvis/cogs/dbrand.py b/jarvis/cogs/dbrand.py index 385db4c..835c6dd 100644 --- a/jarvis/cogs/dbrand.py +++ b/jarvis/cogs/dbrand.py @@ -135,7 +135,7 @@ class DbrandCog(Extension): service_data = await service_data.json() fields.append( EmbedField( - service_data["tier-title"], + service_data["carrier"] + " " + service_data["tier-title"], service_data["time-title"], ) ) From e79bb9358f96fc985a77a812741d516ffd9aeed1 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 7 Jun 2022 14:20:56 -0600 Subject: [PATCH 5/5] Handle cache issues with new embeds --- jarvis/cogs/dbrand.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jarvis/cogs/dbrand.py b/jarvis/cogs/dbrand.py index 835c6dd..45f6c68 100644 --- a/jarvis/cogs/dbrand.py +++ b/jarvis/cogs/dbrand.py @@ -127,7 +127,9 @@ class DbrandCog(Extension): fields = None if data is not None and data["is_valid"] and data["shipping_available"]: fields = [] - fields.append(EmbedField(data["tier-title"], data["time-title"])) + fields.append( + EmbedField(data["carrier"] + " " + data["tier-title"], data["time-title"]) + ) for service in data["shipping_services_available"][1:]: service_data = await self._session.get(self.api_url + dest + "/" + service["url"]) if service_data.status > 400: