Skip to content

Commit 0f843ab

Browse files
committed
Update CheapGames.py
1 parent d3113d4 commit 0f843ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commands/games/CheapGames.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ async def trigger_update(self, interaction : Interaction):
305305
config, enabled = await self.db.getExtensionConfig(interaction.guild, Extensions.CHEAPGAMES)
306306
assert enabled, f'The extension is not enabled'
307307

308-
configuration = await self.handle_server_updates((interaction.guild.id, Extensions.CHEAPGAMES.value, enabled, config))
308+
configuration = await self.handle_server_updates((interaction.guild.id, Extensions.CHEAPGAMES.value, enabled, config), True)
309309

310310
async with self.db:
311311
await self.db.editExtensionConfig(interaction.guild, Extensions.CHEAPGAMES, configuration[3])
@@ -346,10 +346,10 @@ async def update_giveaways_and_deals(self):
346346
print(e)
347347
raise e
348348

349-
async def handle_server_updates(self, configuration : tuple[int, str, bool, dict[str, dict[str, dict]]]) -> dict:
349+
async def handle_server_updates(self, configuration : tuple[int, str, bool, dict[str, dict[str, dict]]], skip_time_check : bool = False) -> dict:
350350
_, _, _, config = configuration
351351
for update_name, update_config in config['updates'].items():
352-
if time.localtime().tm_hour != int(update_config["on"]): # IMPORTANT: I need to check if localtime is in UTC.
352+
if time.localtime().tm_hour != int(update_config["on"]) and not skip_time_check: # IMPORTANT: I need to check if localtime is in UTC.
353353
continue
354354

355355
if Api(update_config["api"]) == Api.GIVEAWAYS:

0 commit comments

Comments
 (0)