-
-
Notifications
You must be signed in to change notification settings - Fork 484
feat: Add support for Guild Incident Actions and Incidents Data parsing #2955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thanks for opening this pull request! This pull request can be checked-out with: git fetch origin pull/2955/head:pr-2955
git checkout pr-2955 This pull request can be installed with: pip install git+https://github.com/Pycord-Development/pycord@refs/pull/2955/head |
There was a problem hiding this comment.
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 adds comprehensive support for Discord's Guild Incident Actions API, enabling automated moderation features for guilds experiencing spam or raid incidents.
- Introduces
IncidentsData
model to represent guild incident states with timestamp fields for disabled invites/DMs and detected incidents - Adds
modify_incident_actions
method to the Guild class for programmatically managing incident restrictions - Implements HTTP endpoint integration for the
/guilds/{guild_id}/incident-actions
API route
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
discord/types/guild.py | Adds TypedDict definitions for IncidentsData and ModifyIncidents payloads |
discord/incidents.py | New module containing IncidentsData class with datetime parsing and serialization |
discord/http.py | Implements HTTP client method for modify_guild_incident_actions API endpoint |
discord/guild.py | Integrates incidents_data attribute and modify_incident_actions method into Guild class |
discord/init.py | Exports incidents module in package imports |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Lumouille <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Lumouille <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Soheab <[email protected]> Signed-off-by: Lumouille <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Lumouille <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Soheab <[email protected]> Signed-off-by: Lumouille <[email protected]>
Summary
This PR introduces full support for Discord’s Guild Incident Actions API and Incidents Data Object as defined in the Discord API documentation.
Key Features
• Implemented IncidentsData model to represent the guild’s current incident state:
• invites_disabled_until
• dms_disabled_until
• dm_spam_detected_at
• raid_detected_at
• Added ModifyIncidentsPayload type for modifying incident restrictions via REST.
Notes
• The incidents_data field may be omitted or null for guilds without active incidents.
• This update lays the groundwork for future automation or moderation features (e.g., automated incident reporting, DM lockdowns).
Example Usage
Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.