Skip to content

Commit

Permalink
Stop spamming guild owner on each refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
s0me-1 committed Apr 19, 2023
1 parent 6ae441d commit c257895
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cogs/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ async def resfresh_posts(self):
if not guild.owner_id:
continue

try:
owner = await self.bot.fetch_user(guild.owner_id)
msg = "It seems you're following `{game_id}` but you have not set any channel !\n"
msg += "Please set a channel with `/dt-set-channel` to receives the latests posts."
await owner.send(msg)
logger.info(f'Sent a DM to {guild.name}[{guild.id}] owner to set a channel.')
except disnake.Forbidden:
logger.warning(f'{guild.name}[{guild.id}] owner has blocked his DMs.')
# try:
# owner = await self.bot.fetch_user(guild.owner_id)
# msg = "It seems you're following `{game_id}` but you have not set any channel !\n"
# msg += "Please set a channel with `/dt-set-channel` to receives the latests posts."
# await owner.send(msg)
# logger.info(f'Sent a DM to {guild.name}[{guild.id}] owner to set a channel.')
# except disnake.Forbidden:
# logger.warning(f'{guild.name}[{guild.id}] owner has blocked his DMs.')
continue

if game_id not in embeds_per_gid.keys():
Expand Down

0 comments on commit c257895

Please sign in to comment.