Skip to content

Commit

Permalink
cleaned up register.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nfearnley committed May 21, 2024
1 parent a7dfbbd commit e609be5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sizebot/cogs/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
logger = logging.getLogger("sizebot")


async def add_user_role(member: discord.Member | discord.User):
async def _add_user_role(member: discord.Member | discord.User):
role = get(member.guild.roles, id=ids.sizebotuserrole)
if role is None:
# logger.warn(f"Sizebot user role {ids.sizebotuserrole} not found in guild {member.guild.id}")
Expand All @@ -22,7 +22,7 @@ async def add_user_role(member: discord.Member | discord.User):
await member.add_roles(role, reason="Registered as SizeBot user")


async def remove_user_role(member: discord.Member | discord.User):
async def _remove_user_role(member: discord.Member | discord.User):
role = get(member.guild.roles, id=ids.sizebotuserrole)
if role is None:
# logger.warn(f"Sizebot user role {ids.sizebotuserrole} not found in guild {member.guild.id}")
Expand Down Expand Up @@ -133,7 +133,7 @@ def check(reaction: discord.Reaction, reacter: discord.Member | discord.User) ->

userdb.save(userdata)

await add_user_role(ctx.author)
await _add_user_role(ctx.author)

logger.warn(f"Started registration for a new user: {ctx.author} in guild {ctx.guild.name}!")
logger.info(userdata)
Expand Down Expand Up @@ -204,7 +204,7 @@ def check(reaction: discord.Reaction, reacter: discord.Member | discord.User) ->
# delete the user file
userdb.delete(guild.id, user.id)
# remove the user role
await remove_user_role(user)
await _remove_user_role(user)

logger.warn(f"User {user.id} successfully unregistered.")
await ctx.send(f"Unregistered {user.name}.")
Expand Down

0 comments on commit e609be5

Please sign in to comment.