Skip to content

Conversation

@VincentRPS
Copy link

@VincentRPS VincentRPS commented May 13, 2025

There are a lot of things here, but they should be mostly covered in the changelog.

definitely doesn't work yet, just felt like there was way too much changes not to commit already
@VincentRPS VincentRPS requested a review from Paillat-dev May 15, 2025 19:54
Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

I didn't try running the code yet, will do that later today

Co-authored-by: Paillat <jeremiecotti@ik.me>
Signed-off-by: VincentRPS <vincentbusiness55@gmail.com>
@Paillat-dev
Copy link
Member

@VincentRPS You should also import defaultdict

@Paillat-dev
Copy link
Member

Any news ? See traceback of another error here:

https://canary.discord.com/channels/881207955029110855/881735314987708456/1373639761696133160

@Paillat-dev
Copy link
Member

Congrats @VincentRPS you successfully broke the docs ! 🎉

VincentRPS and others added 3 commits June 28, 2025 22:10
Co-authored-by: Paillat <jeremiecotti@ik.me>
Signed-off-by: VincentRPS <vincentbusiness55@gmail.com>
@Paillat-dev
Copy link
Member

Paillat-dev commented Jul 29, 2025

@VincentRPS I am going to rebase this for you and push here

@VincentRPS
Copy link
Author

@VincentRPS I am going to rebase this for you and push here

M'kay!

@read-the-docs-community
Copy link

read-the-docs-community bot commented Nov 2, 2025

Documentation build overview

📚 pycord-next | 🛠️ Build #30307550 | 📁 Comparing affaff9 against latest (cd7ab41)


🔍 Preview build

Show files changed (108 files in total): 📝 76 modified | ➕ 30 added | ➖ 2 deleted
File Status
cogs.html 📝 modified
faq.html 📝 modified
genindex.html 📝 modified
intents.html 📝 modified
migrating_to_v1.html 📝 modified
migrating_to_v2.html 📝 modified
old_changelog.html 📝 modified
quickstart.html 📝 modified
_modules/index.html 📝 modified
api/abcs.html 📝 modified
api/application_commands.html 📝 modified
api/application_info.html 📝 modified
api/audit_logs.html 📝 modified
api/clients.html 📝 modified
api/data_classes.html 📝 modified
api/enums.html 📝 modified
api/events.html 📝 modified
api/gears.html ➕ added
api/index.html 📝 modified
api/models.html 📝 modified
api/ui_kit.html 📝 modified
api/utils.html 📝 modified
api/voice.html 📝 modified
api/webhooks.html 📝 modified
_modules/discord/abc.html 📝 modified
_modules/discord/appinfo.html 📝 modified
_modules/discord/asset.html 📝 modified
_modules/discord/audit_logs.html 📝 modified
_modules/discord/automod.html 📝 modified
_modules/discord/bot.html 📝 modified
_modules/discord/channel.html ➖ deleted
_modules/discord/client.html 📝 modified
_modules/discord/emoji.html 📝 modified
_modules/discord/enums.html 📝 modified
_modules/discord/errors.html 📝 modified
_modules/discord/flags.html 📝 modified
_modules/discord/guild.html 📝 modified
_modules/discord/interactions.html 📝 modified
_modules/discord/invite.html 📝 modified
_modules/discord/member.html 📝 modified
_modules/discord/message.html 📝 modified
_modules/discord/monetization.html 📝 modified
_modules/discord/partial_emoji.html 📝 modified
_modules/discord/poll.html 📝 modified
_modules/discord/raw_models.html 📝 modified
_modules/discord/role.html 📝 modified
_modules/discord/scheduled_events.html 📝 modified
_modules/discord/shard.html 📝 modified
_modules/discord/stage_instance.html 📝 modified
_modules/discord/sticker.html 📝 modified
_modules/discord/team.html 📝 modified
_modules/discord/template.html 📝 modified
_modules/discord/threads.html ➖ deleted
_modules/discord/user.html 📝 modified
_modules/discord/voice_client.html 📝 modified
_modules/discord/widget.html 📝 modified
ext/commands/api.html 📝 modified
ext/commands/cogs.html 📝 modified
ext/commands/commands.html 📝 modified
ext/commands/extensions.html 📝 modified
ext/pages/index.html 📝 modified
_modules/discord/channel/category.html ➕ added
_modules/discord/channel/dm.html ➕ added
_modules/discord/channel/forum.html ➕ added
_modules/discord/channel/media.html ➕ added
_modules/discord/channel/news.html ➕ added
_modules/discord/channel/partial.html ➕ added
_modules/discord/channel/stage.html ➕ added
_modules/discord/channel/text.html ➕ added
_modules/discord/channel/thread.html ➕ added
_modules/discord/channel/voice.html ➕ added
_modules/discord/commands/context.html 📝 modified
_modules/discord/commands/core.html 📝 modified
_modules/discord/commands/options.html 📝 modified
_modules/discord/events/audit_log.html ➕ added
_modules/discord/events/automod.html ➕ added
_modules/discord/events/channel.html ➕ added
_modules/discord/events/entitlement.html ➕ added
_modules/discord/events/gateway.html ➕ added
_modules/discord/events/guild.html ➕ added
_modules/discord/events/integration.html ➕ added
_modules/discord/events/interaction.html ➕ added
_modules/discord/events/invite.html ➕ added
_modules/discord/events/message.html ➕ added
_modules/discord/events/scheduled_event.html ➕ added
_modules/discord/events/soundboard.html ➕ added
_modules/discord/events/stage_instance.html ➕ added
_modules/discord/events/subscription.html ➕ added
_modules/discord/events/thread.html ➕ added
_modules/discord/events/typing.html ➕ added
_modules/discord/events/voice.html ➕ added
_modules/discord/events/webhook.html ➕ added
_modules/discord/gears/gear.html ➕ added
_modules/discord/ui/container.html 📝 modified
_modules/discord/ui/modal.html 📝 modified
_modules/discord/ui/section.html 📝 modified
_modules/discord/ui/select.html 📝 modified
_modules/discord/ui/view.html 📝 modified
_modules/discord/utils/public.html 📝 modified
modules/discord/webhook/async.html 📝 modified
_modules/discord/webhook/sync.html 📝 modified
_modules/discord/ext/bridge/core.html 📝 modified
_modules/discord/ext/commands/cog.html 📝 modified
_modules/discord/ext/commands/context.html 📝 modified
_modules/discord/ext/commands/converter.html 📝 modified
_modules/discord/ext/commands/cooldowns.html 📝 modified
_modules/discord/ext/commands/errors.html 📝 modified
_modules/discord/ext/commands/help.html 📝 modified

Copy link

Copilot AI left a 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 implements a major refactor of the ConnectionState and event handling system, migrating from a parser-based dispatch model to an event emitter pattern. The changes convert many synchronous operations to async, introduce a new event system, and restructure how Discord gateway events are processed.

Key Changes

  • Refactored ConnectionState into a new app.state module with async event handling
  • Introduced a new event emitter system with typed events in discord/events/ directory
  • Converted many synchronous methods to async (e.g., _get_guild, get_member, store_user)
  • Added generic type support for interactions and improved type safety across the codebase

Reviewed Changes

Copilot reviewed 82 out of 129 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
discord/state.py Completely removed - migrated to app.state
discord/types/interactions.py Added generic type support and more specific interaction type definitions
discord/types/channel.py Introduced channel type hierarchy with base classes
discord/template.py Converted to async factory pattern, updated state imports
discord/guild.py Major async conversion of member/emoji/sticker operations
discord/message.py Converted to async factory pattern, removed update handlers
discord/member.py Added async factory method _from_data
discord/interactions.py Added generic type support and async conversion
discord/gateway.py Removed dispatch listeners, switched to event emitter
discord/events/*.py New event system implementation files
discord/gears/*.py New modular event handling system

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

Migrate 18 remaining parse_x methods from ConnectionState to new Event subclasses following the established event migration pattern.

Created event files:
- audit_log.py: GuildAuditLogEntryCreate
- scheduled_event.py: GuildScheduledEvent{Create,Update,Delete,UserAdd,UserRemove}
- integration.py: GuildIntegrationsUpdate, Integration{Create,Update,Delete}
- stage_instance.py: StageInstance{Create,Update,Delete}
- voice.py: VoiceStateUpdate, VoiceServerUpdate, VoiceChannelStatusUpdate
- typing.py: TypingStart
- webhook.py: WebhooksUpdate

Changes to ConnectionState:
- Removed 18 parse_x methods
- Removed _get_typing_user helper (moved to typing.py)
- Cleaned up unused imports (AuditLogEntry, ScheduledEventStatus, _integration_factory, ScheduledEvent, StageInstance)
- Kept parse_guild_members_chunk (internal infrastructure)

Bug fixes:
- Fixed subscriber count decrement in GuildScheduledEventUserRemove

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Paillat-dev and others added 11 commits November 13, 2025 12:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Paillat <jeremiecotti@ik.me>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Paillat <jeremiecotti@ik.me>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Paillat <jeremiecotti@ik.me>
Co-authored-by: Emma Terzioglu <emreterzioglu49@gmail.com>
Signed-off-by: Paillat <jeremiecotti@ik.me>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Paillat <jeremiecotti@ik.me>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Paillat <jeremiecotti@ik.me>
@Paillat-dev Paillat-dev requested a review from plun1331 November 13, 2025 11:52
@VincentRPS VincentRPS marked this pull request as ready for review November 13, 2025 12:17
@VincentRPS VincentRPS requested a review from a team as a code owner November 13, 2025 12:17
Signed-off-by: Vincent Jose <vincentbusiness55@gmail.com>
Removed duplicated GuildCreate, GuildJoin, and GuildAvailable event classes from gateway.py.

Signed-off-by: Vincent Jose <vincentbusiness55@gmail.com>
Copy link
Author

@VincentRPS VincentRPS left a comment

Choose a reason for hiding this comment

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

fix for old threads

VincentRPS and others added 4 commits November 13, 2025 20:43
Signed-off-by: Vincent Jose <vincentbusiness55@gmail.com>
Signed-off-by: Vincent Jose <vincentbusiness55@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vincent Jose <vincentbusiness55@gmail.com>
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.

Rewrite a better caching system

7 participants