-
Notifications
You must be signed in to change notification settings - Fork 1
refactor!: ConnectionState & Event Handling #5
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
definitely doesn't work yet, just felt like there was way too much changes not to commit already
large part left is the ConnectionState itself since events haven't been transformed yet
I need to make more commits
Paillat-dev
left a comment
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.
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>
|
@VincentRPS You should also import defaultdict |
|
Any news ? See traceback of another error here: https://canary.discord.com/channels/881207955029110855/881735314987708456/1373639761696133160 |
Signed-off-by: VincentRPS <vincentbusiness55@gmail.com>
|
Congrats @VincentRPS you successfully broke the docs ! 🎉 |
Co-authored-by: Paillat <jeremiecotti@ik.me> Signed-off-by: VincentRPS <vincentbusiness55@gmail.com>
|
@VincentRPS I am going to rebase this for you and push here |
M'kay! |
…guild_role_update, guild_role_delete
| ) | ||
| return | ||
|
|
||
| member = await guild.get_member(int(data["user"]["id"])) |
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.
Normally people aren't members of guilds that they're being unbanned from
EmmmaTech
left a comment
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.
:3
| return await self.cache.get_all_stickers() | ||
|
|
||
| async def get_emoji(self, emoji_id: int | None) -> GuildEmoji | AppEmoji | None: | ||
| return await self.get_emoji(emoji_id) |
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.
| return await self.get_emoji(emoji_id) | |
| return await self.cache.get_emoji(emoji_id) |
| await state.maybe_store_app_emoji(state.application_id, e) | ||
|
|
||
|
|
||
| class GuildCreate(Event, Guild): |
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.
this (among a few other events) appears to be duplicated in guild.py?
discord/app/state.py
Outdated
| else: | ||
| self.dispatch("guild_join", guild) | ||
|
|
||
| def parse_guild_audit_log_entry_create(self, data) -> None: |
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.
I assume these leftover parse functions have yet to be converted into events?
|
@VincentRPS are you still working on this ? |
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)
Co-Authored-By: Claude <noreply@anthropic.com>
definitely doesn't work yet