Skip to content

Conversation

Copy link

Copilot AI commented Oct 29, 2025

Admins need the ability to automatically handle introductions from members who leave the server, with manual confirmation before deletion.

Changes

Commands

  • /intro-channel - Sets the introductions channel
  • /admin-messages-channel - Sets the admin notification channel
  • /intro-auto-delete - Toggles feature enable/disable

Event Handler

  • guildMemberRemove - On member departure, searches intro channel for their messages (limit 100), sends confirmation request to admin channel with Delete/Keep buttons

Button Interactions

  • Delete: Removes intro message, updates confirmation with success/error
  • Keep: Dismisses confirmation, no action

Database

  • IntroChannelSetting model stores introChannelId, adminMessagesChannelId, autoDeleteEnabled per guild
  • Added MongoDB CRUD functions for intro settings

Integration

  • Registered commands in activeCommands.ts
  • Added GuildMessages and MessageContent intents for message fetching
  • Button handler uses Promise.allSettled for concurrent admin notifications
// Admin confirmation includes message preview and actions
await adminChannel.send({
  content: `**Member Left:** ${username}\n**Message:** \`\`\`${preview}\`\`\`\n[Jump to Message](${url})`,
  components: [row], // Delete/Keep buttons
})

Note: Fetches last 100 messages only. Messages beyond that limit won't be detected.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fastdl.mongodb.org
    • Triggering command: /usr/local/bin/node ./postinstall.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Remove introduction for user's who leave</issue_title>
<issue_description>As a server admin I want to have a command to enable/disable a function of the bot where when it detects that a server member leaves the server any message from the member who left that is in the specified introductions channel is removed.

  • There should be a /intro-auto-delete command that can be set to either enable or disable.
  • There should be a /intro-channel commannd which specifies the server's introductions channel.
  • There should be a /admin-messages-channel command which specifies the private channel where to send message to the admin.
  • When a member of the server leaves it should trigger the bot to check for any messages left by that user in the channel set by /admin-messages-channel asking if the admin wants to delete the specified message with an action button to confirm.
  • Clicking the confirm button on the admin messages channel message should delete the message in the intro channel.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits October 29, 2025 04:30
Co-authored-by: davis9001 <72961+davis9001@users.noreply.github.com>
Co-authored-by: davis9001 <72961+davis9001@users.noreply.github.com>
Co-authored-by: davis9001 <72961+davis9001@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove introduction messages when users leave Add intro auto-delete feature for departed members Oct 29, 2025
Copilot AI requested a review from davis9001 October 29, 2025 04:39
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.

Remove introduction for user's who leave

2 participants