Skip to content

Commit

Permalink
Skip players who no longer exist in RGL and handle inappropriate topics
Browse files Browse the repository at this point in the history
  • Loading branch information
Ooglely committed Apr 5, 2024
1 parent c0ab498 commit 92a07f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pug/manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ async def update_channel_status(self):
)
except nextcord.errors.Forbidden:
print("Missing permissions to edit channel topic.\nGuild: ", guild)
except nextcord.HTTPException:
print(
"HTTP Exception when editing channel topic. Likely inappropriate username.\nGuild: ",
guild,
)

@status_check.error
@update_channel_status.error
Expand Down
5 changes: 3 additions & 2 deletions registration/update_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def __init__(self, bot: nextcord.Client):
self.bot: nextcord.Client = bot
self.update_rgl.start() # pylint: disable=no-member

@tasks.loop(time=update_time) # time=update_time
@tasks.loop(time=update_time)
async def update_rgl(self):
"""
Updates RGL divisions and roles for all registered players in all guilds
Expand Down Expand Up @@ -400,7 +400,8 @@ async def update_rgl(self):
await asyncio.sleep(30)
except LookupError as err:
print(err, "Somehow this player is registered though??")
continue
ban_check = True
await asyncio.sleep(15)

# Attempt to update this player in every guild they are in
for loaded in guilds.values():
Expand Down

0 comments on commit 92a07f7

Please sign in to comment.