mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-12-03 14:02:19 +00:00
Type up Guild Scheduled Events
This commit is contained in:
@@ -35,6 +35,7 @@ from typing import (
|
||||
Dict,
|
||||
Iterable,
|
||||
List,
|
||||
Literal,
|
||||
Optional,
|
||||
Sequence,
|
||||
TYPE_CHECKING,
|
||||
@@ -42,6 +43,7 @@ from typing import (
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from urllib.parse import quote as _uriquote
|
||||
import weakref
|
||||
@@ -83,6 +85,7 @@ if TYPE_CHECKING:
|
||||
widget,
|
||||
threads,
|
||||
voice,
|
||||
scheduled_event,
|
||||
sticker,
|
||||
)
|
||||
from .types.snowflake import Snowflake, SnowflakeList
|
||||
@@ -1532,6 +1535,24 @@ class HTTPClient:
|
||||
def delete_stage_instance(self, channel_id: Snowflake, *, reason: Optional[str] = None) -> Response[None]:
|
||||
return self.request(Route('DELETE', '/stage-instances/{channel_id}', channel_id=channel_id), reason=reason)
|
||||
|
||||
# Guild scheduled event management
|
||||
|
||||
@overload
|
||||
def get_scheduled_events(
|
||||
self, guild_id: Snowflake, with_user_count: Literal[True]
|
||||
) -> Response[List[scheduled_event.GuildScheduledEventWithUserCount]]:
|
||||
...
|
||||
|
||||
@overload
|
||||
def get_scheduled_events(
|
||||
self, guild_id: Snowflake, with_user_count: Literal[False]
|
||||
) -> Response[List[scheduled_event.GuildScheduledEvent]]:
|
||||
...
|
||||
|
||||
def get_scheduled_events(self, guild_id: Snowflake, with_user_count: bool) -> Response[Any]:
|
||||
payload = {'with_user_count': with_user_count}
|
||||
return self.request(Route('GET', '/guilds/{guild_id}/scheduled-events', guild_id=guild_id), json=payload)
|
||||
|
||||
# Application commands (global)
|
||||
|
||||
def get_global_commands(self, application_id: Snowflake) -> Response[List[interactions.ApplicationCommand]]:
|
||||
|
||||
Reference in New Issue
Block a user