Skip to content

Commit

Permalink
[AFK] fix nickname updater
Browse files Browse the repository at this point in the history
  • Loading branch information
japandotorg committed Nov 2, 2023
1 parent 9aba6e6 commit 30d74e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion afk/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,15 @@ async def _update_nickname(self, member: discord.Member, *, force: bool = False)
if force:
if len(original) > 26:
return
forced: str = f"{custom}{original}"
elif original.startswith(custom):
forced: str = original[len(custom) :]
if forced == (member.global_name or member.name):
forced = None # type: ignore
else:
return
try:
await member.edit(nick=forced) # type: ignore
await member.edit(nick=forced)
except discord.HTTPException:
pass

Expand Down

0 comments on commit 30d74e7

Please sign in to comment.