Skip to content

Chore: Fix the cleanup of Verification channel - #176

Open
kritarth2135 wants to merge 6 commits into
masterfrom
chore/verification-channel-cleanup
Open

Chore: Fix the cleanup of Verification channel#176
kritarth2135 wants to merge 6 commits into
masterfrom
chore/verification-channel-cleanup

Conversation

@kritarth2135

Copy link
Copy Markdown
Collaborator

Description of your PR

Fixes the already written code for the cleanup of verification channel

Describe your changes

Added

None

Fixed

Verification channel cleanup

Changed

Skipping logging deleted messages from the verification process in the LoggingMessageDelete Cog

Removed

None

Issue link

Closes #156

Checklist

  • Does an issue of this PR exist and have you linked it?
  • Have your ran pre-commit over your PR?
  • Was this PR branched off from master?
  • Is this PR merging to master?

@kritarth2135 kritarth2135 self-assigned this Aug 17, 2026
@kritarth2135 kritarth2135 added the chore repo/project maintenance label Aug 17, 2026
@kritarth2135
kritarth2135 requested a review from Xarlos89 August 17, 2026 11:30

@Xarlos89 Xarlos89 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good, but a few small things that would prevent merging. Nice PR.

# await sleep(8)
# bot_message.delete() # remove the message to correct people after 8? seconds
@commands.Cog.listener()
async def on_message(self, message):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never actually handle a direct Message, which means the first if gate on line 89 will exit with an attribute error. In a DM, the message.author is a discord.User, which has no .guild.

Additionally, message.author.bot is checked only on 96, so this will probably not send out the DM in the first place

else:
await ctx.send("You are already verified. Go away.")
msg = await ctx.send("You are already verified. Go away.")
sleep(10)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sleep here blocks the event loop, which means another user cannot use the >verify command. We should instead use asyncio.sleep(), so it doesn't do that. I feel like I also remember a delete_after=10.0 argument in ctx.send(), but double check that.

)
sleep(3)
await response.resource.delete()
await interaction.user.kick(reason="User admitted to being a robot.")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the resource.delete fails for any reason, the kick might not happen. Could we wrap this in a try-excepty to handle this more gracefully?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore repo/project maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Verification Channel Clog Up

2 participants