diff options
| author | 2020-12-24 17:58:15 +0200 | |
|---|---|---|
| committer | 2020-12-24 17:58:15 +0200 | |
| commit | a5f09a880ec7911f53ecb3b83f6d6290fa46e27b (patch) | |
| tree | 40df034712932f223c4f5eb34ef323af03d330e8 | |
| parent | Merge pull request #1337 from python-discord/ks123/pep (diff) | |
| parent | `if user.pending` -> `if not user.pending` (diff) | |
Merge pull request #1328 from python-discord/swfarnsworth/developer_command
Manual verification with `!verify` sends the user the confirmation DM.
| -rw-r--r-- | bot/exts/moderation/verification.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/bot/exts/moderation/verification.py b/bot/exts/moderation/verification.py index 6239cf522..ce91dcb15 100644 --- a/bot/exts/moderation/verification.py +++ b/bot/exts/moderation/verification.py @@ -55,7 +55,7 @@ If you'd like to unsubscribe from the announcement notifications, simply send `! """ 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>. @@ -834,19 +834,21 @@ class Verification(Cog): @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 |