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

Fix #1244 #1246

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def _update(self, guild: Guild, data: TextChannelPayload) -> None:
self.name: str = data["name"]
self.category_id: Optional[int] = utils._get_as_snowflake(data, "parent_id")
self.topic: Optional[str] = data.get("topic")
self.position: int = data["position"]
self.position: int = data.get("position")
self.nsfw: bool = data.get("nsfw", False)
# Does this need coercion into `int`? No idea yet.
self.slowmode_delay: int = data.get("rate_limit_per_user", 0)
Expand Down Expand Up @@ -816,7 +816,7 @@ def _update(self, guild: Guild, data: Union[VoiceChannelPayload, StageChannelPay
self.video_quality_mode: VideoQualityMode = try_enum(VideoQualityMode, data.get("video_quality_mode", 1))
self.category_id: Optional[int] = utils._get_as_snowflake(data, "parent_id")
self.last_message_id: Optional[int] = utils._get_as_snowflake(data, 'last_message_id')
self.position: int = data["position"]
self.position: int = data.get("position")
Copy link
Member

Choose a reason for hiding this comment

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

Does this change have anything to do with this issue?

self.bitrate: int = data.get("bitrate")
self.user_limit: int = data.get("user_limit")
self._fill_overwrites(data)
Expand Down
2 changes: 1 addition & 1 deletion discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ async def _invoke(self, ctx: ApplicationContext) -> None:
obj_type = Role
kw["guild"] = ctx.guild
elif op.input_type is SlashCommandOptionType.channel:
obj_type = _guild_channel_factory(_data["type"])
obj_type, _ = _guild_channel_factory(_data["type"])
kw["guild"] = ctx.guild
elif op.input_type is SlashCommandOptionType.attachment:
obj_type = Attachment
Expand Down