Skip to content
22 changes: 12 additions & 10 deletions bot/exts/moderation/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"""

ALTERNATE_VERIFIED_MESSAGE = f"""
Thanks for accepting our rules!
You are now verified!

You can find a copy of our rules for reference at <https://pythondiscord.com/pages/rules>.

Expand Down Expand Up @@ -834,19 +834,21 @@ async def bot_check(ctx: Context) -> bool:

@command(name='verify')
@has_any_role(*constants.MODERATION_ROLES)
async def apply_developer_role(self, ctx: Context, user: discord.Member) -> None:
"""Command for moderators to apply the Developer role to any user."""
async def perform_manual_verification(self, ctx: Context, user: discord.Member) -> None:
"""Command for moderators to verify any user."""
log.trace(f'verify command called by {ctx.author} for {user.id}.')
developer_role = self.bot.get_guild(constants.Guild.id).get_role(constants.Roles.verified)

if developer_role in user.roles:
log.trace(f'{user.id} is already a developer, aborting.')
await ctx.send(f'{constants.Emojis.cross_mark} {user} is already a developer.')
if not user.pending:
log.trace(f'{user.id} is already verified, aborting.')
await ctx.send(f'{constants.Emojis.cross_mark} {user.mention} is already verified.')
return

await user.add_roles(developer_role)
log.trace(f'Developer role successfully applied to {user.id}')
await ctx.send(f'{constants.Emojis.check_mark} Developer role applied to {user}.')
# Adding a role automatically verifies the user, so we add and remove the Announcements role.
temporary_role = self.bot.get_guild(constants.Guild.id).get_role(constants.Roles.announcements)
await user.add_roles(temporary_role)
await user.remove_roles(temporary_role)
log.trace(f'{user.id} manually verified.')
await ctx.send(f'{constants.Emojis.check_mark} {user.mention} is now verified.')

# endregion

Expand Down