Skip to content

Commit

Permalink
Allow discord.Object use for permissions in channel creation
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshardmind authored Jul 10, 2024
1 parent 97ca618 commit 7d3eff9
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ def _create_channel(
self,
name: str,
channel_type: Literal[ChannelType.text],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ...,
**options: Any,
) -> Coroutine[Any, Any, TextChannelPayload]:
Expand All @@ -1137,7 +1137,7 @@ def _create_channel(
self,
name: str,
channel_type: Literal[ChannelType.voice],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ...,
**options: Any,
) -> Coroutine[Any, Any, VoiceChannelPayload]:
Expand All @@ -1148,7 +1148,7 @@ def _create_channel(
self,
name: str,
channel_type: Literal[ChannelType.stage_voice],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ...,
**options: Any,
) -> Coroutine[Any, Any, StageChannelPayload]:
Expand All @@ -1159,7 +1159,7 @@ def _create_channel(
self,
name: str,
channel_type: Literal[ChannelType.category],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ...,
**options: Any,
) -> Coroutine[Any, Any, CategoryChannelPayload]:
Expand All @@ -1170,7 +1170,7 @@ def _create_channel(
self,
name: str,
channel_type: Literal[ChannelType.news],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ...,
**options: Any,
) -> Coroutine[Any, Any, NewsChannelPayload]:
Expand All @@ -1181,7 +1181,7 @@ def _create_channel(
self,
name: str,
channel_type: Literal[ChannelType.news, ChannelType.text],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ...,
**options: Any,
) -> Coroutine[Any, Any, Union[TextChannelPayload, NewsChannelPayload]]:
Expand All @@ -1192,7 +1192,7 @@ def _create_channel(
self,
name: str,
channel_type: Literal[ChannelType.forum],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ...,
**options: Any,
) -> Coroutine[Any, Any, ForumChannelPayload]:
Expand All @@ -1203,7 +1203,7 @@ def _create_channel(
self,
name: str,
channel_type: ChannelType,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ...,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ...,
**options: Any,
) -> Coroutine[Any, Any, GuildChannelPayload]:
Expand All @@ -1213,7 +1213,7 @@ def _create_channel(
self,
name: str,
channel_type: ChannelType,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
category: Optional[Snowflake] = None,
**options: Any,
) -> Coroutine[Any, Any, GuildChannelPayload]:
Expand Down Expand Up @@ -1253,7 +1253,7 @@ async def create_text_channel(
topic: str = MISSING,
slowmode_delay: int = MISSING,
nsfw: bool = MISSING,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
default_auto_archive_duration: int = MISSING,
default_thread_slowmode_delay: int = MISSING,
) -> TextChannel:
Expand Down Expand Up @@ -1395,7 +1395,7 @@ async def create_voice_channel(
user_limit: int = MISSING,
rtc_region: Optional[str] = MISSING,
video_quality_mode: VideoQualityMode = MISSING,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
) -> VoiceChannel:
"""|coro|
Expand Down Expand Up @@ -1488,7 +1488,7 @@ async def create_stage_channel(
user_limit: int = MISSING,
rtc_region: Optional[str] = MISSING,
video_quality_mode: VideoQualityMode = MISSING,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
) -> StageChannel:
"""|coro|
Expand Down Expand Up @@ -1581,7 +1581,7 @@ async def create_category(
self,
name: str,
*,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
reason: Optional[str] = None,
position: int = MISSING,
) -> CategoryChannel:
Expand Down Expand Up @@ -1636,7 +1636,7 @@ async def create_forum(
category: Optional[CategoryChannel] = None,
slowmode_delay: int = MISSING,
nsfw: bool = MISSING,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING,
overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
reason: Optional[str] = None,
default_auto_archive_duration: int = MISSING,
default_thread_slowmode_delay: int = MISSING,
Expand Down

0 comments on commit 7d3eff9

Please sign in to comment.