From 28e53bbe5d4704734d714e648e84584f782b8ff6 Mon Sep 17 00:00:00 2001 From: Tiffinini <97678636+Tiffinini@users.noreply.github.com> Date: Sun, 10 Apr 2022 07:08:37 +0100 Subject: [PATCH 1/2] Update core.py --- discord/commands/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/commands/core.py b/discord/commands/core.py index a6686fe3a6..4d527a16ca 100644 --- a/discord/commands/core.py +++ b/discord/commands/core.py @@ -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 From 8bedb844042ddb2a6b76e46c278cddd3356ccebb Mon Sep 17 00:00:00 2001 From: Tiffinini <97678636+Tiffinini@users.noreply.github.com> Date: Sun, 10 Apr 2022 07:20:36 +0100 Subject: [PATCH 2/2] Update channel.py --- discord/channel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/channel.py b/discord/channel.py index 339a5a12ef..bbbf82acaa 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -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) @@ -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") self.bitrate: int = data.get("bitrate") self.user_limit: int = data.get("user_limit") self._fill_overwrites(data)