Browse Source

Allow discord.Object use for permissions in channel creation

pull/9898/head
Michael H 9 months ago
committed by GitHub
parent
commit
7d3eff9d9d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 28
      discord/guild.py

28
discord/guild.py

@ -1126,7 +1126,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
channel_type: Literal[ChannelType.text], channel_type: Literal[ChannelType.text],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ..., overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ..., category: Optional[Snowflake] = ...,
**options: Any, **options: Any,
) -> Coroutine[Any, Any, TextChannelPayload]: ) -> Coroutine[Any, Any, TextChannelPayload]:
@ -1137,7 +1137,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
channel_type: Literal[ChannelType.voice], channel_type: Literal[ChannelType.voice],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ..., overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ..., category: Optional[Snowflake] = ...,
**options: Any, **options: Any,
) -> Coroutine[Any, Any, VoiceChannelPayload]: ) -> Coroutine[Any, Any, VoiceChannelPayload]:
@ -1148,7 +1148,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
channel_type: Literal[ChannelType.stage_voice], channel_type: Literal[ChannelType.stage_voice],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ..., overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ..., category: Optional[Snowflake] = ...,
**options: Any, **options: Any,
) -> Coroutine[Any, Any, StageChannelPayload]: ) -> Coroutine[Any, Any, StageChannelPayload]:
@ -1159,7 +1159,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
channel_type: Literal[ChannelType.category], channel_type: Literal[ChannelType.category],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ..., overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ..., category: Optional[Snowflake] = ...,
**options: Any, **options: Any,
) -> Coroutine[Any, Any, CategoryChannelPayload]: ) -> Coroutine[Any, Any, CategoryChannelPayload]:
@ -1170,7 +1170,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
channel_type: Literal[ChannelType.news], channel_type: Literal[ChannelType.news],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ..., overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ..., category: Optional[Snowflake] = ...,
**options: Any, **options: Any,
) -> Coroutine[Any, Any, NewsChannelPayload]: ) -> Coroutine[Any, Any, NewsChannelPayload]:
@ -1181,7 +1181,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
channel_type: Literal[ChannelType.news, ChannelType.text], channel_type: Literal[ChannelType.news, ChannelType.text],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ..., overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ..., category: Optional[Snowflake] = ...,
**options: Any, **options: Any,
) -> Coroutine[Any, Any, Union[TextChannelPayload, NewsChannelPayload]]: ) -> Coroutine[Any, Any, Union[TextChannelPayload, NewsChannelPayload]]:
@ -1192,7 +1192,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
channel_type: Literal[ChannelType.forum], channel_type: Literal[ChannelType.forum],
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ..., overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ..., category: Optional[Snowflake] = ...,
**options: Any, **options: Any,
) -> Coroutine[Any, Any, ForumChannelPayload]: ) -> Coroutine[Any, Any, ForumChannelPayload]:
@ -1203,7 +1203,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
channel_type: ChannelType, channel_type: ChannelType,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = ..., overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = ...,
category: Optional[Snowflake] = ..., category: Optional[Snowflake] = ...,
**options: Any, **options: Any,
) -> Coroutine[Any, Any, GuildChannelPayload]: ) -> Coroutine[Any, Any, GuildChannelPayload]:
@ -1213,7 +1213,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
channel_type: ChannelType, channel_type: ChannelType,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING, overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
category: Optional[Snowflake] = None, category: Optional[Snowflake] = None,
**options: Any, **options: Any,
) -> Coroutine[Any, Any, GuildChannelPayload]: ) -> Coroutine[Any, Any, GuildChannelPayload]:
@ -1253,7 +1253,7 @@ class Guild(Hashable):
topic: str = MISSING, topic: str = MISSING,
slowmode_delay: int = MISSING, slowmode_delay: int = MISSING,
nsfw: bool = 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_auto_archive_duration: int = MISSING,
default_thread_slowmode_delay: int = MISSING, default_thread_slowmode_delay: int = MISSING,
) -> TextChannel: ) -> TextChannel:
@ -1395,7 +1395,7 @@ class Guild(Hashable):
user_limit: int = MISSING, user_limit: int = MISSING,
rtc_region: Optional[str] = MISSING, rtc_region: Optional[str] = MISSING,
video_quality_mode: VideoQualityMode = MISSING, video_quality_mode: VideoQualityMode = MISSING,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING, overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
) -> VoiceChannel: ) -> VoiceChannel:
"""|coro| """|coro|
@ -1488,7 +1488,7 @@ class Guild(Hashable):
user_limit: int = MISSING, user_limit: int = MISSING,
rtc_region: Optional[str] = MISSING, rtc_region: Optional[str] = MISSING,
video_quality_mode: VideoQualityMode = MISSING, video_quality_mode: VideoQualityMode = MISSING,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING, overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
) -> StageChannel: ) -> StageChannel:
"""|coro| """|coro|
@ -1581,7 +1581,7 @@ class Guild(Hashable):
self, self,
name: str, name: str,
*, *,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING, overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
reason: Optional[str] = None, reason: Optional[str] = None,
position: int = MISSING, position: int = MISSING,
) -> CategoryChannel: ) -> CategoryChannel:
@ -1636,7 +1636,7 @@ class Guild(Hashable):
category: Optional[CategoryChannel] = None, category: Optional[CategoryChannel] = None,
slowmode_delay: int = MISSING, slowmode_delay: int = MISSING,
nsfw: bool = MISSING, nsfw: bool = MISSING,
overwrites: Mapping[Union[Role, Member], PermissionOverwrite] = MISSING, overwrites: Mapping[Union[Role, Member, Object], PermissionOverwrite] = MISSING,
reason: Optional[str] = None, reason: Optional[str] = None,
default_auto_archive_duration: int = MISSING, default_auto_archive_duration: int = MISSING,
default_thread_slowmode_delay: int = MISSING, default_thread_slowmode_delay: int = MISSING,

Loading…
Cancel
Save