Skip to content

probation commands#2

Merged
sam51210 merged 1 commit into
mainfrom
samprobation-270626
Jul 26, 2026
Merged

probation commands#2
sam51210 merged 1 commit into
mainfrom
samprobation-270626

Conversation

@sam51210

Copy link
Copy Markdown
Member

pls accept aep

@sam51210
sam51210 requested review from Aeplet and Copilot July 26, 2026 22:34
@sam51210
sam51210 merged commit 6937f3d into main Jul 26, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Discord bot’s moderation command permissions and adds two new utility commands (speak and purge) intended for privileged users.

Changes:

  • Fixes permission decorator usage for kick/unban by using @commands.has_permissions(...).
  • Adds speak (bot relays arbitrary text) and purge (bulk message deletion with filtering).
  • Introduces a bot user ID constant used to avoid purging the bot’s own messages.
Comments suppressed due to low confidence (1)

bot.py:445

  • purge skips messages by comparing to a hard-coded BOT_USER_ID. This can be wrong (or stale) and causes the bot to potentially delete its own messages. Use the runtime bot user id instead.
    deleted = await ctx.channel.purge(
        limit=(limit + 1),
        check=lambda message: message.author.id != BOT_USER_ID and not message.pinned,
    )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bot.py
Comment on lines +436 to +437
@bot.command()
@commands.has_any_role(PROTECTED_ROLE_ID)
Comment thread bot.py
Comment on lines +433 to +434
async def speak(ctx, *, msg="Please provide a message to send."):
await ctx.send(msg)
Comment thread bot.py
Comment on lines +431 to +433
@bot.command()
@commands.has_any_role(IMMUNE_BYPASS_ROLE_ID)
async def speak(ctx, *, msg="Please provide a message to send."):
Comment thread bot.py

PROTECTED_ROLE_ID = int(os.getenv("PROTECTED_ROLE_ID"))
IMMUNE_BYPASS_ROLE_ID = int(os.getenv("IMMUNE_BYPASS_ROLE_ID"))
BOT_USER_ID = 1522945518932725810
@sam51210
sam51210 deleted the samprobation-270626 branch July 27, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants