Skip to content
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

Add new interaction channel attribute #1621

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davfsa
Copy link
Member

@davfsa davfsa commented May 25, 2023

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

@davfsa davfsa added the enhancement New feature or request label May 25, 2023
@davfsa davfsa requested a review from FasterSpeeding May 25, 2023 11:22
@davfsa
Copy link
Member Author

davfsa commented May 25, 2023

I am not sure whether to get rid of BaseInteraction.get_channel and BaseInteraction.fetch_channel, as they are a bit replaced here. The only difference is the more concrete type.

I would get rid of them, but I would like more feedback :)

@@ -2542,7 +2542,7 @@ def deserialize_command_interaction(
guild_id=guild_id,
guild_locale=locales.Locale(payload["guild_locale"]) if "guild_locale" in payload else None,
locale=locales.Locale(payload["locale"]),
channel_id=snowflakes.Snowflake(payload["channel_id"]),
channel=self.deserialize_partial_channel(payload["channel"]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

the channel objects here include a lot more fields than just the partial channel's fields

e.g.

{
    "type": 0,
    "topic": null,
    "theme_color": null,
    "rate_limit_per_user": 0,
    "position": 20,
    "permissions": "140737488355327",
    "parent_id": "561885448721399808",
    "nsfw": false,
    "name": "dwads",
    "last_message_id": "1114922806820479057",
    "id": "717586538925523004",
    "icon_emoji": {
        "name": "\ud83e\udd16",
        "id": null
    },
    "guild_id": "561884984214814744",
    "flags": 0,
    "default_auto_archive_duration": 60
}
{
    "type": 1,
    "last_message_id": "1096465893028003910",
    "id": "463185043796262922",
    "flags": 0
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

This was also mentioned in the PR which documented this field discord/discord-api-docs#6051 (comment), just another case of Discord having shit docs tbh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants