From d466a5730ef13d60774c87193e076176db3b7b31 Mon Sep 17 00:00:00 2001 From: Toricane Date: Sat, 16 Jul 2022 21:58:30 -0700 Subject: [PATCH 1/5] docs: remove question marks in docstrings --- interactions/api/dispatch.py | 2 +- interactions/api/gateway/client.py | 12 +- interactions/api/http/request.py | 2 +- interactions/api/http/route.py | 2 +- interactions/api/models/channel.py | 146 +++++----- interactions/api/models/guild.py | 352 ++++++++++++------------ interactions/api/models/gw.py | 92 +++---- interactions/api/models/member.py | 46 ++-- interactions/api/models/message.py | 236 ++++++++-------- interactions/api/models/misc.py | 6 +- interactions/api/models/presence.py | 48 ++-- interactions/api/models/role.py | 30 +- interactions/api/models/team.py | 24 +- interactions/api/models/user.py | 26 +- interactions/api/models/webhook.py | 14 +- interactions/client/bot.py | 78 +++--- interactions/client/context.py | 34 +-- interactions/client/models/command.py | 54 ++-- interactions/client/models/component.py | 62 ++--- interactions/client/models/misc.py | 24 +- interactions/client/models/utils.py | 8 +- interactions/ext/base.py | 8 +- interactions/ext/version.py | 14 +- 23 files changed, 660 insertions(+), 660 deletions(-) diff --git a/interactions/api/dispatch.py b/interactions/api/dispatch.py index 4183e1ed6..c7ce8a5dd 100644 --- a/interactions/api/dispatch.py +++ b/interactions/api/dispatch.py @@ -57,7 +57,7 @@ def register(self, coro: Callable[..., Coroutine], name: Optional[str] = None) - :param coro: The coroutine to register as an event. :type coro: Callable[..., Coroutine] - :param name?: The name to associate the coroutine with. Defaults to None. + :param name: The name to associate the coroutine with. Defaults to None. :type name: Optional[str] """ _name: str = coro.__name__ if name is None else name diff --git a/interactions/api/gateway/client.py b/interactions/api/gateway/client.py index fe6926dee..21999d963 100644 --- a/interactions/api/gateway/client.py +++ b/interactions/api/gateway/client.py @@ -101,9 +101,9 @@ def __init__( :type token: str :param intents: The Gateway intents of the application for event dispatch. :type intents: Intents - :param session_id?: The ID of the session if trying to reconnect. Defaults to ``None``. + :param session_id: The ID of the session if trying to reconnect. Defaults to ``None``. :type session_id: Optional[str] - :param sequence?: The identifier sequence if trying to reconnect. Defaults to ``None``. + :param sequence: The identifier sequence if trying to reconnect. Defaults to ``None``. :type sequence: Optional[int] """ try: @@ -167,7 +167,7 @@ async def _establish_connection( """ Establishes a client connection with the Gateway. - :param shard?: The shards to establish a connection with. Defaults to ``None``. + :param shard: The shards to establish a connection with. Defaults to ``None``. :type shard: Optional[List[Tuple[int]]] :param presence: The presence to carry with. Defaults to ``None``. :type presence: Optional[ClientPresence] @@ -209,7 +209,7 @@ async def _handle_connection( :param stream: The packet stream to handle. :type stream: Dict[str, Any] - :param shard?: The shards to establish a connection with. Defaults to ``None``. + :param shard: The shards to establish a connection with. Defaults to ``None``. :type shard: Optional[List[Tuple[int]]] :param presence: The presence to carry with. Defaults to ``None``. :type presence: Optional[ClientPresence] @@ -660,9 +660,9 @@ async def __identify( """ Sends an ``IDENTIFY`` packet to the gateway. - :param shard?: The shard ID to identify under. + :param shard: The shard ID to identify under. :type shard: Optional[List[Tuple[int]]] - :param presence?: The presence to change the bot to on identify. + :param presence: The presence to change the bot to on identify. :type presence: Optional[ClientPresence] """ self.__shard = shard diff --git a/interactions/api/http/request.py b/interactions/api/http/request.py index 96d9d6779..086fed0b7 100644 --- a/interactions/api/http/request.py +++ b/interactions/api/http/request.py @@ -92,7 +92,7 @@ async def request(self, route: Route, **kwargs) -> Optional[Any]: :param route: The HTTP route to request. :type route: Route - :param \**kwargs?: Optional keyword-only arguments to pass as information in the request. + :param \**kwargs: Optional keyword-only arguments to pass as information in the request. :type \**kwargs: dict :return: The contents of the request if any. :rtype: Optional[Any] diff --git a/interactions/api/http/route.py b/interactions/api/http/route.py index cf20a2455..1f3d45567 100644 --- a/interactions/api/http/route.py +++ b/interactions/api/http/route.py @@ -27,7 +27,7 @@ def __init__(self, method: str, path: str, **kwargs) -> None: :type method: str :param path: The path of the HTTP/URL. :type path: str - :param \**kwargs?: Optional keyword-only arguments to pass as information in the route. + :param \**kwargs: Optional keyword-only arguments to pass as information in the route. :type \**kwargs: dict """ self.method = method diff --git a/interactions/api/models/channel.py b/interactions/api/models/channel.py index cef609b04..0f59e8706 100644 --- a/interactions/api/models/channel.py +++ b/interactions/api/models/channel.py @@ -59,7 +59,7 @@ class ThreadMetadata(DictSerializerMixin): :ivar int auto_archive_duration: The auto-archive time. :ivar datetime archive_timestamp: The timestamp that the thread will be/has been closed at. :ivar bool locked: The current message state of the thread. - :ivar Optional[bool] invitable?: The ability to invite users to the thread. + :ivar Optional[bool] invitable: The ability to invite users to the thread. """ archived: bool = field() @@ -78,7 +78,7 @@ class ThreadMember(ClientSerializerMixin): ``id`` only shows if there are active intents involved with the member in the thread. - :ivar Optional[Snowflake] id?: The "ID" or intents of the member. + :ivar Optional[Snowflake] id: The "ID" or intents of the member. :ivar Snowflake user_id: The user ID of the member. :ivar datetime join_timestamp: The timestamp of when the member joined the thread. :ivar int flags: The bitshift flags for the member in the thread. @@ -104,30 +104,30 @@ class Channel(ClientSerializerMixin, IDMixin): :ivar Snowflake id: The (snowflake) ID of the channel. :ivar ChannelType type: The type of channel. - :ivar Optional[Snowflake] guild_id?: The ID of the guild if it is not a DM channel. - :ivar Optional[int] position?: The position of the channel. + :ivar Optional[Snowflake] guild_id: The ID of the guild if it is not a DM channel. + :ivar Optional[int] position: The position of the channel. :ivar List[Overwrite] permission_overwrites: The non-synced permissions of the channel. :ivar str name: The name of the channel. - :ivar Optional[str] topic?: The description of the channel. - :ivar Optional[bool] nsfw?: Whether the channel is NSFW. + :ivar Optional[str] topic: The description of the channel. + :ivar Optional[bool] nsfw: Whether the channel is NSFW. :ivar Snowflake last_message_id: The ID of the last message sent. - :ivar Optional[int] bitrate?: The audio bitrate of the channel. - :ivar Optional[int] user_limit?: The maximum amount of users allowed in the channel. - :ivar Optional[int] rate_limit_per_user?: The concurrent ratelimit for users in the channel. - :ivar Optional[List[User]] recipients?: The recipients of the channel. - :ivar Optional[str] icon?: The icon of the channel. - :ivar Optional[Snowflake] owner_id?: The owner of the channel. - :ivar Optional[Snowflake] application_id?: The application of the channel. - :ivar Optional[Snowflake] parent_id?: The ID of the "parent"/main channel. - :ivar Optional[datetime] last_pin_timestamp?: The timestamp of the last pinned message in the channel. - :ivar Optional[str] rtc_region?: The region of the WebRTC connection for the channel. - :ivar Optional[int] video_quality_mode?: The set quality mode for video streaming in the channel. + :ivar Optional[int] bitrate: The audio bitrate of the channel. + :ivar Optional[int] user_limit: The maximum amount of users allowed in the channel. + :ivar Optional[int] rate_limit_per_user: The concurrent ratelimit for users in the channel. + :ivar Optional[List[User]] recipients: The recipients of the channel. + :ivar Optional[str] icon: The icon of the channel. + :ivar Optional[Snowflake] owner_id: The owner of the channel. + :ivar Optional[Snowflake] application_id: The application of the channel. + :ivar Optional[Snowflake] parent_id: The ID of the "parent"/main channel. + :ivar Optional[datetime] last_pin_timestamp: The timestamp of the last pinned message in the channel. + :ivar Optional[str] rtc_region: The region of the WebRTC connection for the channel. + :ivar Optional[int] video_quality_mode: The set quality mode for video streaming in the channel. :ivar int message_count: The amount of messages in the channel. - :ivar Optional[int] member_count?: The amount of members in the channel. - :ivar Optional[ThreadMetadata] thread_metadata?: The thread metadata of the channel. - :ivar Optional[ThreadMember] member?: The member of the thread in the channel. - :ivar Optional[int] default_auto_archive_duration?: The set auto-archive time for all threads to naturally follow in the channel. - :ivar Optional[str] permissions?: The permissions of the channel. + :ivar Optional[int] member_count: The amount of members in the channel. + :ivar Optional[ThreadMetadata] thread_metadata: The thread metadata of the channel. + :ivar Optional[ThreadMember] member: The member of the thread in the channel. + :ivar Optional[int] default_auto_archive_duration: The set auto-archive time for all threads to naturally follow in the channel. + :ivar Optional[str] permissions: The permissions of the channel. """ __slots__ = ( @@ -209,21 +209,21 @@ async def send( """ Sends a message in the channel. - :param content?: The contents of the message as a string or string-converted value. + :param content: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param files?: A file or list of files to be attached to the message. + :param files: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param embeds?: An embed, or list of embeds for the message. + :param embeds: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions?: The message interactions/mention limits that the message can refer to. + :param allowed_mentions: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] - :param stickers?: A list of stickers to send with your message. You can send up to 3 stickers per message. + :param stickers: A list of stickers to send with your message. You can send up to 3 stickers per message. :type stickers: Optional[List[Sticker]] - :param components?: A component, or list of components for the message. + :param components: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[Actionrow], List[Button], List[SelectMenu]]] :return: The sent message as an object. :rtype: Message @@ -313,31 +313,31 @@ async def modify( .. note:: The fields `archived`, `auto_archive_duration` and `locked` require the provided channel to be a thread. - :param name?: The name of the channel, defaults to the current value of the channel + :param name: The name of the channel, defaults to the current value of the channel :type name: str - :param topic?: The topic of that channel, defaults to the current value of the channel + :param topic: The topic of that channel, defaults to the current value of the channel :type topic: Optional[str] - :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel + :param bitrate: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel :type bitrate: Optional[int] - :param user_limit?: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel + :param user_limit: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel :type user_limit: Optional[int] - :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel + :param rate_limit_per_use: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel :type rate_limit_per_user: Optional[int] - :param position?: Sorting position of the channel, defaults to the current value of the channel + :param position: Sorting position of the channel, defaults to the current value of the channel :type position: Optional[int] - :param parent_id?: The id of the parent category for a channel, defaults to the current value of the channel + :param parent_id: The id of the parent category for a channel, defaults to the current value of the channel :type parent_id: Optional[int] - :param nsfw?: Whether the channel is nsfw or not, defaults to the current value of the channel + :param nsfw: Whether the channel is nsfw or not, defaults to the current value of the channel :type nsfw: Optional[bool] - :param permission_overwrites?: The permission overwrites, if any + :param permission_overwrites: The permission overwrites, if any :type permission_overwrites: Optional[List[Overwrite]] - :param archived?: Whether the thread is archived + :param archived: Whether the thread is archived :type archived: Optional[bool] - :param auto_archive_duration?: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 + :param auto_archive_duration: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param locked?: Whether the thread is locked + :param locked: Whether the thread is locked :type locked: Optional[bool] - :param reason?: The reason for the edit + :param reason: The reason for the edit :type reason: Optional[str] :return: The modified channel as new object :rtype: Channel @@ -413,7 +413,7 @@ async def set_name( :param name: The new name of the channel :type name: str - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -432,7 +432,7 @@ async def set_topic( :param topic: The new topic of the channel :type topic: str - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -451,7 +451,7 @@ async def set_bitrate( :param bitrate: The new bitrate of the channel :type bitrate: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -473,7 +473,7 @@ async def set_user_limit( :param user_limit: The new user limit of the channel :type user_limit: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -497,7 +497,7 @@ async def set_rate_limit_per_user( :param rate_limit_per_user: The new rate_limit_per_user of the channel (0-21600) :type rate_limit_per_user: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -516,7 +516,7 @@ async def set_position( :param position: The new position of the channel :type position: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -535,7 +535,7 @@ async def set_parent_id( :param parent_id: The new parent_id of the channel :type parent_id: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -554,7 +554,7 @@ async def set_nsfw( :param nsfw: The new nsfw-flag of the channel :type nsfw: bool - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -573,7 +573,7 @@ async def archive( :param archived: Whether the Thread is archived, defaults to True :type archived: bool - :param reason?: The reason of the archiving + :param reason: The reason of the archiving :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -592,7 +592,7 @@ async def set_auto_archive_duration( :param auto_archive_duration: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 :type auto_archive_duration: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -611,7 +611,7 @@ async def lock( :param locked: Whether the Thread is locked, defaults to True :type locked: bool - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -777,13 +777,13 @@ def check_pinned(message): :param amount: The amount of messages to delete :type amount: int - :param check?: The function used to check if a message should be deleted. The message is only deleted if the check returns `True` + :param check: The function used to check if a message should be deleted. The message is only deleted if the check returns `True` :type check: Callable[[Message], bool] - :param before?: An id of a message to purge only messages before that message + :param before: An id of a message to purge only messages before that message :type before: Optional[int] - :param bulk?: Whether to bulk delete the messages (you cannot delete messages older than 14 days, default) or to delete every message seperately + :param bulk: Whether to bulk delete the messages (you cannot delete messages older than 14 days, default) or to delete every message seperately :param bulk: Optional[bool] - :param reason?: The reason of the deletes + :param reason: The reason of the deletes :type reason: Optional[str] :return: A list of the deleted messages :rtype: List[Message] @@ -972,16 +972,16 @@ async def create_thread( :param name: The name of the thread :type name: str - :param auto_archive_duration?: duration in minutes to automatically archive the thread after recent activity, + :param auto_archive_duration: duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param type?: The type of thread, defaults to public. ignored if creating thread from a message + :param type: The type of thread, defaults to public. ignored if creating thread from a message :type type: Optional[ChannelType] - :param invitable?: Boolean to display if the Thread is open to join or private. + :param invitable: Boolean to display if the Thread is open to join or private. :type invitable: Optional[bool] - :param message_id?: An optional message to create a thread from. + :param message_id: An optional message to create a thread from. :type message_id: Optional[Union[int, Snowflake, "Message"]] - :param reason?: An optional reason for the audit log + :param reason: An optional reason for the audit log :type reason: Optional[str] :return: The created thread :rtype: Channel @@ -1035,21 +1035,21 @@ async def create_invite( """ Creates an invite for the channel - :param max_age?: Duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days). Default 86400 (24h) + :param max_age: Duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days). Default 86400 (24h) :type max_age: Optional[int] - :param max_uses?: Max number of uses or 0 for unlimited. between 0 and 100. Default 0 + :param max_uses: Max number of uses or 0 for unlimited. between 0 and 100. Default 0 :type max_uses: Optional[int] - :param temporary?: Whether this invite only grants temporary membership. Default False + :param temporary: Whether this invite only grants temporary membership. Default False :type temporary: Optional[bool] - :param unique?: If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). Default False + :param unique: If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). Default False :type unique: Optional[bool] - :param target_type?: The type of target for this voice channel invite + :param target_type: The type of target for this voice channel invite :type target_type: Optional["InviteTargetType"] - :param target_user_id?: The id of the user whose stream to display for this invite, required if target_type is STREAM, the user must be streaming in the channel + :param target_user_id: The id of the user whose stream to display for this invite, required if target_type is STREAM, the user must be streaming in the channel :type target_user_id: Optional[int] - :param target_application_id?: The id of the embedded application to open for this invite, required if target_type is EMBEDDED_APPLICATION, the application must have the EMBEDDED flag + :param target_application_id: The id of the embedded application to open for this invite, required if target_type is EMBEDDED_APPLICATION, the application must have the EMBEDDED flag :type target_application_id: Optional[int] - :param reason?: The reason for the creation of the invite + :param reason: The reason for the creation of the invite :type reason: Optional[str] """ @@ -1105,8 +1105,8 @@ async def get_history(self, limit: int = 100) -> Optional[List["Message"]]: """ Gets messages from the channel's history. - :param limit?: The amount of messages to get. Default 100 - :type limit?: int + :param limit: The amount of messages to get. Default 100 + :type limit: int :return: A list of messages :rtype: List[Message] """ diff --git a/interactions/api/models/guild.py b/interactions/api/models/guild.py index 20964d430..4a2c22dcd 100644 --- a/interactions/api/models/guild.py +++ b/interactions/api/models/guild.py @@ -138,8 +138,8 @@ class WelcomeChannels(DictSerializerMixin): :ivar Snowflake channel_id: The ID of the welcome channel. :ivar str description: The description of the welcome channel. - :ivar Optional[Snowflake] emoji_id?: The ID of the emoji of the welcome channel. - :ivar Optional[str] emoji_name?: The name of the emoji of the welcome channel. + :ivar Optional[Snowflake] emoji_id: The ID of the emoji of the welcome channel. + :ivar Optional[str] emoji_name: The name of the emoji of the welcome channel. """ channel_id: int = field() @@ -158,7 +158,7 @@ class WelcomeScreen(DictSerializerMixin): We assume it's for the welcome screen topic. - :ivar Optional[str] description?: The description of the welcome screen. + :ivar Optional[str] description: The description of the welcome screen. :ivar List[WelcomeChannels] welcome_channels: A list of welcome channels of the welcome screen. """ @@ -220,18 +220,18 @@ class Guild(ClientSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the guild. :ivar str name: The name of the guild. - :ivar Optional[str] icon?: The icon of the guild. - :ivar Optional[str] icon_hash?: The hashed version of the icon of the guild. - :ivar Optional[str] splash?: The invite splash banner of the guild. - :ivar Optional[str] discovery_splash?: The discovery splash banner of the guild. - :ivar Optional[bool] owner?: Whether the guild is owned. + :ivar Optional[str] icon: The icon of the guild. + :ivar Optional[str] icon_hash: The hashed version of the icon of the guild. + :ivar Optional[str] splash: The invite splash banner of the guild. + :ivar Optional[str] discovery_splash: The discovery splash banner of the guild. + :ivar Optional[bool] owner: Whether the guild is owned. :ivar Snowflake owner_id: The ID of the owner of the guild. - :ivar Optional[str] permissions?: The permissions of the guild. - :ivar Optional[str] region?: The geographical region of the guild. - :ivar Optional[Snowflake] afk_channel_id?: The AFK voice channel of the guild. + :ivar Optional[str] permissions: The permissions of the guild. + :ivar Optional[str] region: The geographical region of the guild. + :ivar Optional[Snowflake] afk_channel_id: The AFK voice channel of the guild. :ivar int afk_timeout: The timeout of the AFK voice channel of the guild. - :ivar Optional[bool] widget_enabled?: Whether widgets are enabled in the guild. - :ivar Optional[Snowflake] widget_channel_id?: The channel ID of the widget in the guild. + :ivar Optional[bool] widget_enabled: Whether widgets are enabled in the guild. + :ivar Optional[Snowflake] widget_channel_id: The channel ID of the widget in the guild. :ivar int verification_level: The level of user verification of the guild. :ivar int default_message_notifications: The default message notifications setting of the guild. :ivar int explicit_content_filter: The explicit content filter setting level of the guild. @@ -239,34 +239,34 @@ class Guild(ClientSerializerMixin, IDMixin): :ivar List[Emoji] emojis: The list of emojis from the guild. :ivar List[GuildFeature] features: The list of features of the guild. :ivar int mfa_level: The MFA level of the guild. - :ivar Optional[Snowflake] application_id?: The application ID of the guild. - :ivar Optional[Snowflake] system_channel_id?: The channel ID of the system of the guild. - :ivar Optional[Snowflake] rules_channel_id?: The channel ID of Discord's defined "rules" channel of the guild. - :ivar Optional[datetime] joined_at?: The timestamp the member joined the guild. - :ivar Optional[bool] large?: Whether the guild is considered "large." - :ivar Optional[bool] unavailable?: Whether the guild is unavailable to access. - :ivar Optional[int] member_count?: The amount of members in the guild. - :ivar Optional[List[Member]] members?: The members in the guild. - :ivar Optional[List[Channel]] channels?: The channels in the guild. - :ivar Optional[List[Thread]] threads?: All known threads in the guild. - :ivar Optional[List[PresenceUpdate]] presences?: The list of presences in the guild. - :ivar Optional[int] max_presences?: The maximum amount of presences allowed in the guild. - :ivar Optional[int] max_members?: The maximum amount of members allowed in the guild. - :ivar Optional[str] vanity_url_code?: The vanity URL of the guild. - :ivar Optional[str] description?: The description of the guild. - :ivar Optional[str] banner?: The banner of the guild. + :ivar Optional[Snowflake] application_id: The application ID of the guild. + :ivar Optional[Snowflake] system_channel_id: The channel ID of the system of the guild. + :ivar Optional[Snowflake] rules_channel_id: The channel ID of Discord's defined "rules" channel of the guild. + :ivar Optional[datetime] joined_at: The timestamp the member joined the guild. + :ivar Optional[bool] large: Whether the guild is considered "large." + :ivar Optional[bool] unavailable: Whether the guild is unavailable to access. + :ivar Optional[int] member_count: The amount of members in the guild. + :ivar Optional[List[Member]] members: The members in the guild. + :ivar Optional[List[Channel]] channels: The channels in the guild. + :ivar Optional[List[Thread]] threads: All known threads in the guild. + :ivar Optional[List[PresenceUpdate]] presences: The list of presences in the guild. + :ivar Optional[int] max_presences: The maximum amount of presences allowed in the guild. + :ivar Optional[int] max_members: The maximum amount of members allowed in the guild. + :ivar Optional[str] vanity_url_code: The vanity URL of the guild. + :ivar Optional[str] description: The description of the guild. + :ivar Optional[str] banner: The banner of the guild. :ivar int premium_tier: The server boost level of the guild. - :ivar Optional[int] premium_subscription_count?: The amount of server boosters in the guild. + :ivar Optional[int] premium_subscription_count: The amount of server boosters in the guild. :ivar str preferred_locale: The "preferred" local region of the guild. - :ivar Optional[Snowflake] public_updates_channel_id?: The channel ID for community updates of the guild. - :ivar Optional[int] max_video_channel_users?: The maximum amount of video streaming members in a channel allowed in a guild. - :ivar Optional[int] approximate_member_count?: The approximate amount of members in the guild. - :ivar Optional[int] approximate_presence_count?: The approximate amount of presences in the guild. - :ivar Optional[WelcomeScreen] welcome_screen?: The welcome screen of the guild. + :ivar Optional[Snowflake] public_updates_channel_id: The channel ID for community updates of the guild. + :ivar Optional[int] max_video_channel_users: The maximum amount of video streaming members in a channel allowed in a guild. + :ivar Optional[int] approximate_member_count: The approximate amount of members in the guild. + :ivar Optional[int] approximate_presence_count: The approximate amount of presences in the guild. + :ivar Optional[WelcomeScreen] welcome_screen: The welcome screen of the guild. :ivar int nsfw_level: The NSFW safety filter level of the guild. - :ivar Optional[List[StageInstance]] stage_instances?: The stage instance of the guild. - :ivar Optional[List[Sticker]] stickers?: The list of stickers from the guild. - :ivar Optional[bool] premium_progress_bar_enabled?: Whether the guild has the boost progress bar enabled. + :ivar Optional[List[StageInstance]] stage_instances: The stage instance of the guild. + :ivar Optional[List[Sticker]] stickers: The list of stickers from the guild. + :ivar Optional[bool] premium_progress_bar_enabled: Whether the guild has the boost progress bar enabled. """ id: Snowflake = field(converter=Snowflake) @@ -373,9 +373,9 @@ async def ban( :param member_id: The id of the member to ban :type member_id: Union[int, Member, Snowflake] - :param reason?: The reason of the ban + :param reason: The reason of the ban :type reason: Optional[str] - :param delete_message_days?: Number of days to delete messages, from 0 to 7. Defaults to 0 + :param delete_message_days: Number of days to delete messages, from 0 to 7. Defaults to 0 :type delete_message_days: Optional[int] """ if not self._client: @@ -405,7 +405,7 @@ async def remove_ban( :param user_id: The id of the user to remove the ban from :type user_id: Union[int, Snowflake] - :param reason?: The reason for the removal of the ban + :param reason: The reason for the removal of the ban :type reason: Optional[str] """ if not self._client: @@ -426,7 +426,7 @@ async def kick( :param member_id: The id of the member to kick :type member_id: Union[int, Member, Snowflake] - :param reason?: The reason for the kick + :param reason: The reason for the kick :type reason: Optional[str] """ if not self._client: @@ -455,7 +455,7 @@ async def add_member_role( :type role Union[Role, int, Snowflake] :param member_id: The id of the member to add the roles to :type member_id: Union[Member, int, Snowflake] - :param reason?: The reason why the roles are added + :param reason: The reason why the roles are added :type reason: Optional[str] """ if not self._client: @@ -484,7 +484,7 @@ async def remove_member_role( :type role: Union[Role, int, Snowflake] :param member_id: The id of the member to remove the roles from :type member_id: Union[Member, int, Snowflake] - :param reason?: The reason why the roles are removed + :param reason: The reason why the roles are removed :type reason: Optional[str] """ if not self._client: @@ -516,19 +516,19 @@ async def create_role( :param name: The name of the role :type name: str - :param color?: RGB color value as integer, default ``0`` + :param color: RGB color value as integer, default ``0`` :type color: Optional[int] - :param permissions?: Bitwise value of the enabled/disabled permissions + :param permissions: Bitwise value of the enabled/disabled permissions :type permissions: Optional[int] - :param hoist?: Whether the role should be displayed separately in the sidebar, default ``False`` + :param hoist: Whether the role should be displayed separately in the sidebar, default ``False`` :type hoist: Optional[bool] - :param icon?: The role's icon image (if the guild has the ROLE_ICONS feature) + :param icon: The role's icon image (if the guild has the ROLE_ICONS feature) :type icon: Optional[Image] - :param unicode_emoji?: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature) + :param unicode_emoji: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature) :type unicode_emoji: Optional[str] - :param mentionable?: Whether the role should be mentionable, default ``False`` + :param mentionable: Whether the role should be mentionable, default ``False`` :type mentionable: Optional[bool] - :param reason?: The reason why the role is created, default ``None`` + :param reason: The reason why the role is created, default ``None`` :type reason: Optional[str] :return: The created Role :rtype: Role @@ -619,7 +619,7 @@ async def delete_role( :param role_id: The id of the role to delete :type role_id: Union[int, Snowflake, Role] - :param reason?: The reason of the deletion + :param reason: The reason of the deletion :type reason: Optional[str] """ if not self._client: @@ -656,21 +656,21 @@ async def modify_role( :param role_id: The id of the role to edit :type role_id: Union[int, Snowflake, Role] - :param name?: The name of the role, defaults to the current value of the role + :param name: The name of the role, defaults to the current value of the role :type name: Optional[str] - :param color?: RGB color value as integer, defaults to the current value of the role + :param color: RGB color value as integer, defaults to the current value of the role :type color: Optional[int] - :param permissions?: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role + :param permissions: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role :type permissions: Optional[int] - :param hoist?: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role + :param hoist: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role :type hoist: Optional[bool] - :param icon?: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role + :param icon: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role :type icon: Optional[Image] - :param unicode_emoji?: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role + :param unicode_emoji: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role :type unicode_emoji: Optional[str] - :param mentionable?: Whether the role should be mentionable, defaults to the current value of the role + :param mentionable: Whether the role should be mentionable, defaults to the current value of the role :type mentionable: Optional[bool] - :param reason?: The reason why the role is edited, default ``None`` + :param reason: The reason why the role is edited, default ``None`` :type reason: Optional[str] :return: The modified role object :rtype: Role @@ -735,16 +735,16 @@ async def create_thread( :type name: str :param channel_id: The id of the channel to create the thread in :type channel_id: Union[int, Snowflake, Channel] - :param auto_archive_duration?: duration in minutes to automatically archive the thread after recent activity, + :param auto_archive_duration: duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param type?: The type of thread, defaults to public. ignored if creating thread from a message + :param type: The type of thread, defaults to public. ignored if creating thread from a message :type type: Optional[ChannelType] - :param invitable?: Boolean to display if the Thread is open to join or private. + :param invitable: Boolean to display if the Thread is open to join or private. :type invitable: Optional[bool] - :param message_id?: An optional message to create a thread from. + :param message_id: An optional message to create a thread from. :type message_id: Optional[Union[int, Snowflake, "Message"]] - :param reason?: An optional reason for the audit log + :param reason: An optional reason for the audit log :type reason: Optional[str] :return: The created thread :rtype: Channel @@ -801,21 +801,21 @@ async def create_channel( :type name: str :param type: The type of the channel :type type: ChannelType - :param topic?: The topic of that channel + :param topic: The topic of that channel :type topic: Optional[str] - :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel + :param bitrate: (voice channel only) The bitrate (in bits) of the voice channel :type bitrate: Optional[int] - :param user_limit?: (voice channel only) Maximum amount of users in the channel + :param user_limit: (voice channel only) Maximum amount of users in the channel :type user_limit: Optional[int] - :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600) + :param rate_limit_per_use: Amount of seconds a user has to wait before sending another message (0-21600) :type rate_limit_per_user: Optional[int] - :param position?: Sorting position of the channel + :param position: Sorting position of the channel :type position: Optional[int] - :param parent_id?: The id of the parent category for a channel + :param parent_id: The id of the parent category for a channel :type parent_id: Optional[Union[int, Channel, Snowflake]] - :param permission_overwrites?: The permission overwrites, if any + :param permission_overwrites: The permission overwrites, if any :type permission_overwrites: Optional[Overwrite] - :param nsfw?: Whether the channel is nsfw or not, default ``False`` + :param nsfw: Whether the channel is nsfw or not, default ``False`` :type nsfw: Optional[bool] :param reason: The reason for the creation :type reason: Optional[str] @@ -928,29 +928,29 @@ async def modify_channel( :param channel_id: The id of the channel to modify :type channel_id: Union[int, Snowflake, Channel] - :param name?: The name of the channel, defaults to the current value of the channel + :param name: The name of the channel, defaults to the current value of the channel :type name: str - :param topic?: The topic of that channel, defaults to the current value of the channel + :param topic: The topic of that channel, defaults to the current value of the channel :type topic: Optional[str] - :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel + :param bitrate: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel :type bitrate: Optional[int] - :param user_limit?: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel + :param user_limit: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel :type user_limit: Optional[int] - :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel + :param rate_limit_per_use: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel :type rate_limit_per_user: Optional[int] - :param position?: Sorting position of the channel, defaults to the current value of the channel + :param position: Sorting position of the channel, defaults to the current value of the channel :type position: Optional[int] - :param parent_id?: The id of the parent category for a channel, defaults to the current value of the channel + :param parent_id: The id of the parent category for a channel, defaults to the current value of the channel :type parent_id: Optional[int] - :param permission_overwrites?: The permission overwrites, if any + :param permission_overwrites: The permission overwrites, if any :type permission_overwrites: Optional[Overwrite] - :param nsfw?: Whether the channel is nsfw or not, defaults to the current value of the channel + :param nsfw: Whether the channel is nsfw or not, defaults to the current value of the channel :type nsfw: Optional[bool] - :param archived?: Whether the thread is archived + :param archived: Whether the thread is archived :type archived: Optional[bool] - :param auto_archive_duration?: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 + :param auto_archive_duration: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param locked?: Whether the thread is locked + :param locked: Whether the thread is locked :type locked: Optional[bool] :param reason: The reason for the edit :type reason: Optional[str] @@ -1049,19 +1049,19 @@ async def modify_member( :param member_id: The id of the member to modify :type member_id: Union[int, Snowflake, Member] - :param nick?: The nickname of the member + :param nick: The nickname of the member :type nick: Optional[str] - :param roles?: A list of all role ids the member has + :param roles: A list of all role ids the member has :type roles: Optional[List[int]] - :param mute?: whether the user is muted in voice channels + :param mute: whether the user is muted in voice channels :type mute: Optional[bool] - :param deaf?: whether the user is deafened in voice channels + :param deaf: whether the user is deafened in voice channels :type deaf: Optional[bool] - :param channel_id?: id of channel to move user to (if they are connected to voice) + :param channel_id: id of channel to move user to (if they are connected to voice) :type channel_id: Optional[int] - :param communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) + :param communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) :type communication_disabled_until: Optional[datetime.isoformat] - :param reason?: The reason of the modifying + :param reason: The reason of the modifying :type reason: Optional[str] :return: The modified member :rtype: Member @@ -1156,49 +1156,49 @@ async def modify( """ Modifies the current guild. - :param name?: The new name of the guild + :param name: The new name of the guild :type name: Optional[str] - :param verification_level?: The verification level of the guild + :param verification_level: The verification level of the guild :type verification_level: Optional[VerificationLevel] - :param default_message_notifications?: The default message notification level for members + :param default_message_notifications: The default message notification level for members :type default_message_notifications: Optional[DefaultMessageNotificationLevel] - :param explicit_content_filter?: The explicit content filter level for media content + :param explicit_content_filter: The explicit content filter level for media content :type explicit_content_filter: Optional[ExplicitContentFilterLevel] - :param afk_channel_id?: The id for the afk voice channel + :param afk_channel_id: The id for the afk voice channel :type afk_channel_id: Optional[int] - :param afk_timeout?: Afk timeout in seconds + :param afk_timeout: Afk timeout in seconds :type afk_timeout: Optional[int] - :param icon?: 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature) + :param icon: 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature) :type icon: Optional[Image] - :param owner_id?: The id of the user to transfer the guild ownership to. You must be the owner to perform this + :param owner_id: The id of the user to transfer the guild ownership to. You must be the owner to perform this :type owner_id: Optional[int] - :param splash?: 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature) + :param splash: 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature) :type splash: Optional[Image] - :param discovery_splash?: 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature) + :param discovery_splash: 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature) :type discovery_splash: Optional[Image] - :param banner?: 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature; can be animated gif when the server has the ANIMATED_BANNER feature) + :param banner: 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature; can be animated gif when the server has the ANIMATED_BANNER feature) :type banner: Optional[Image] - :param system_channel_id?: The id of the channel where guild notices such as welcome messages and boost events are posted + :param system_channel_id: The id of the channel where guild notices such as welcome messages and boost events are posted :type system_channel_id: Optional[int] - :param suppress_join_notifications?: Whether to suppress member join notifications in the system channel or not + :param suppress_join_notifications: Whether to suppress member join notifications in the system channel or not :type suppress_join_notifications: Optional[bool] - :param suppress_premium_subscriptions?: Whether to suppress server boost notifications in the system channel or not + :param suppress_premium_subscriptions: Whether to suppress server boost notifications in the system channel or not :type suppress_premium_subscriptions: Optional[bool] - :param suppress_guild_reminder_notifications?: Whether to suppress server setup tips in the system channel or not + :param suppress_guild_reminder_notifications: Whether to suppress server setup tips in the system channel or not :type suppress_guild_reminder_notifications: Optional[bool] - :param suppress_join_notification_replies?: Whether to hide member join sticker reply buttons in the system channel or not + :param suppress_join_notification_replies: Whether to hide member join sticker reply buttons in the system channel or not :type suppress_join_notification_replies: Optional[bool] - :param rules_channel_id?: The id of the channel where guilds display rules and/or guidelines + :param rules_channel_id: The id of the channel where guilds display rules and/or guidelines :type rules_channel_id: Optional[int] - :param public_updates_channel_id?: The id of the channel where admins and moderators of community guilds receive notices from Discord + :param public_updates_channel_id: The id of the channel where admins and moderators of community guilds receive notices from Discord :type public_updates_channel_id: Optional[int] - :param preferred_locale?: The preferred locale of a community guild used in server discovery and notices from Discord; defaults to "en-US" + :param preferred_locale: The preferred locale of a community guild used in server discovery and notices from Discord; defaults to "en-US" :type preferred_locale: Optional[str] - :param description?: The description for the guild, if the guild is discoverable + :param description: The description for the guild, if the guild is discoverable :type description: Optional[str] - :param premium_progress_bar_enabled?: Whether the guild's boost progress bar is enabled + :param premium_progress_bar_enabled: Whether the guild's boost progress bar is enabled :type premium_progress_bar_enabled: Optional[bool] - :param reason?: The reason for the modifying + :param reason: The reason for the modifying :type reason: Optional[str] :return: The modified guild :rtype: Guild @@ -1293,7 +1293,7 @@ async def set_name( :param name: The new name of the guild :type name: str - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(name=name, reason=reason) @@ -1309,7 +1309,7 @@ async def set_verification_level( :param verification_level: The new verification level of the guild :type verification_level: VerificationLevel - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(verification_level=verification_level, reason=reason) @@ -1325,7 +1325,7 @@ async def set_default_message_notifications( :param default_message_notifications: The new default message notification level of the guild :type default_message_notifications: DefaultMessageNotificationLevel - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify( @@ -1343,7 +1343,7 @@ async def set_explicit_content_filter( :param explicit_content_filter: The new explicit content filter level of the guild :type explicit_content_filter: ExplicitContentFilterLevel - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(explicit_content_filter=explicit_content_filter, reason=reason) @@ -1359,7 +1359,7 @@ async def set_afk_channel( :param afk_channel_id: The new name of the guild :type afk_channel_id: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(afk_channel_id=afk_channel_id, reason=reason) @@ -1375,7 +1375,7 @@ async def set_afk_timeout( :param afk_timeout: The new afk timeout of the guild :type afk_timeout: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(afk_timeout=afk_timeout, reason=reason) @@ -1391,7 +1391,7 @@ async def set_system_channel( :param system_channel_id: The new system channel id of the guild :type system_channel_id: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(system_channel_id=system_channel_id, reason=reason) @@ -1407,7 +1407,7 @@ async def set_rules_channel( :param rules_channel_id: The new rules channel id of the guild :type rules_channel_id: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(rules_channel_id=rules_channel_id, reason=reason) @@ -1423,7 +1423,7 @@ async def set_public_updates_channel( :param public_updates_channel_id: The new public updates channel id of the guild :type public_updates_channel_id: int - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(public_updates_channel_id=public_updates_channel_id, reason=reason) @@ -1439,7 +1439,7 @@ async def set_preferred_locale( :param preferred_locale: The new preferredlocale of the guild :type preferred_locale: str - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(preferred_locale=preferred_locale, reason=reason) @@ -1455,7 +1455,7 @@ async def set_description( :param description: The new description of the guild :type description: str - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(description=description, reason=reason) @@ -1471,7 +1471,7 @@ async def set_premium_progress_bar_enabled( :param premium_progress_bar_enabled: Whether the bar is enabled or not :type premium_progress_bar_enabled: bool - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify( @@ -1489,7 +1489,7 @@ async def set_icon( :param icon: The new icon of the guild :type icon: Image - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(icon=icon, reason=reason) @@ -1505,7 +1505,7 @@ async def set_splash( :param splash: The new splash of the guild :type splash: Image - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(splash=splash, reason=reason) @@ -1521,7 +1521,7 @@ async def set_discovery_splash( :param discovery_splash: The new discovery_splash of the guild :type discovery_splash: Image - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(discovery_splash=discovery_splash, reason=reason) @@ -1537,7 +1537,7 @@ async def set_banner( :param banner: The new banner of the guild :type banner: Image - :param reason?: The reason of the edit + :param reason: The reason of the edit :type reason: Optional[str] """ return await self.modify(banner=banner, reason=reason) @@ -1563,16 +1563,16 @@ async def create_scheduled_event( :type entity_type: EntityType :param scheduled_start_time: The time to schedule the scheduled event :type scheduled_start_time: datetime.isoformat - :param scheduled_end_time?: The time when the scheduled event is scheduled to end + :param scheduled_end_time: The time when the scheduled event is scheduled to end :type scheduled_end_time: Optional[datetime.isoformat] - :param entity_metadata?: The entity metadata of the scheduled event + :param entity_metadata: The entity metadata of the scheduled event :type entity_metadata: Optional[EventMetadata] - :param channel_id?: The channel id of the scheduled event. + :param channel_id: The channel id of the scheduled event. :type channel_id: Optional[int] - :param description?: The description of the scheduled event + :param description: The description of the scheduled event :type description: Optional[str] - :param image?: The cover image of the scheduled event - :type image?: Optional[Image] + :param image: The cover image of the scheduled event + :type image: Optional[Image] :return: The created event :rtype: ScheduledEvents """ @@ -1638,18 +1638,18 @@ async def modify_scheduled_event( :type entity_type: Optional[EntityType] :param scheduled_start_time: The time to schedule the scheduled event :type scheduled_start_time: Optional[datetime.isoformat] - :param scheduled_end_time?: The time when the scheduled event is scheduled to end + :param scheduled_end_time: The time when the scheduled event is scheduled to end :type scheduled_end_time: Optional[datetime.isoformat] - :param entity_metadata?: The entity metadata of the scheduled event + :param entity_metadata: The entity metadata of the scheduled event :type entity_metadata: Optional[EventMetadata] - :param channel_id?: The channel id of the scheduled event. + :param channel_id: The channel id of the scheduled event. :type channel_id: Optional[int] - :param description?: The description of the scheduled event + :param description: The description of the scheduled event :type description: Optional[str] - :param status?: The status of the scheduled event + :param status: The status of the scheduled event :type status: Optional[EventStatus] - :param image?: The cover image of the scheduled event - :type image?: Optional[Image] + :param image: The cover image of the scheduled event + :type image: Optional[Image] :return: The modified event :rtype: ScheduledEvents """ @@ -1795,7 +1795,7 @@ async def modify_role_position( :type role_id: Union[Role, int] :param position: The new position of the role :type position: int - :param reason?: The reason for the modifying + :param reason: The reason for the modifying :type reason: Optional[str] :return: List of guild roles with updated hierarchy :rtype: List[Role] @@ -1846,12 +1846,12 @@ async def get_bans( """ Gets a list of banned users. - :param limit?: Number of users to return. Defaults to 1000. - :type limit?: Optional[int] - :param before?: Consider only users before the given User ID snowflake. - :type before?: Optional[int] - :param after?: Consider only users after the given User ID snowflake. - :type after?: Optional[int] + :param limit: Number of users to return. Defaults to 1000. + :type limit: Optional[int] + :param before: Consider only users before the given User ID snowflake. + :type before: Optional[int] + :param after: Consider only users after the given User ID snowflake. + :type after: Optional[int] :return: List of banned users with reasons :rtype: List[Dict[str, User]] """ @@ -1952,12 +1952,12 @@ async def create_emoji( :param image: The image of the emoji. :type image: Image - :param name?: The name of the emoji. If not specified, the filename will be used - :type name?: Optional[str] - :param roles?: Roles allowed to use this emoji - :type roles?: Optional[Union[List[Role], List[int]]] - :param reason?: The reason of the creation - :type reason?: Optional[str] + :param name: The name of the emoji. If not specified, the filename will be used + :type name: Optional[str] + :param roles: Roles allowed to use this emoji + :type roles: Optional[Union[List[Role], List[int]]] + :param reason: The reason of the creation + :type reason: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -1994,8 +1994,8 @@ async def delete_emoji( :param emoji: The emoji or the id of the emoji to delete :type emoji: Union[Emoji, int] - :param reason?: The reason of the deletion - :type reason?: Optional[str] + :param reason: The reason of the deletion + :type reason: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -2020,9 +2020,9 @@ async def get_list_of_members( """ Lists the members of a guild. - :param limit?: How many members to get from the API. Max is 1000. + :param limit: How many members to get from the API. Max is 1000. :type limit: Optional[int] - :param after?: Get only Members after this member. + :param after: Get only Members after this member. :type after: Optional[Union[Member, int]] :return: A list of members :rtype: List[Member] @@ -2050,7 +2050,7 @@ async def search_members(self, query: str, limit: Optional[int] = 1) -> List[Mem :param query: The string to search for :type query: str - :param limit?: The number of members to return. + :param limit: The number of members to return. :type limit: Optional[int] :return: A list of matching members :rtype: List[Member] @@ -2333,14 +2333,14 @@ class GuildPreview(DictSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the guild. :ivar str name: The name of the guild. - :ivar Optional[str] icon?: The icon of the guild. - :ivar Optional[str] splash?: The invite splash banner of the guild. - :ivar Optional[str] discovery_splash?: The discovery splash banner of the guild. + :ivar Optional[str] icon: The icon of the guild. + :ivar Optional[str] splash: The invite splash banner of the guild. + :ivar Optional[str] discovery_splash: The discovery splash banner of the guild. :ivar List[Emoji] emojis: The list of emojis from the guild. :ivar List[GuildFeatures] features: The list of features of the guild. :ivar int approximate_member_count: The approximate amount of members in the guild. :ivar int approximate_presence_count: The approximate amount of presences in the guild. - :ivar Optional[str] description?: The description of the guild. + :ivar Optional[str] description: The description of the guild. """ id: Snowflake = field(converter=Snowflake) @@ -2401,7 +2401,7 @@ class GuildTemplate(DictSerializerMixin): :ivar str code: The code of the guild template. :ivar str name: The name of the guild template. - :ivar Optional[str] description?: The description of the guild template, if given. + :ivar Optional[str] description: The description of the guild template, if given. :ivar int usage_count: The amount of uses on the template. :ivar Snowflake creator_id: User ID of the creator of this template. :ivar User creator: The User object of the creator of this template. @@ -2409,7 +2409,7 @@ class GuildTemplate(DictSerializerMixin): :ivar datetime update_at: The time when this template was updated. :ivar Snowflake source_guild_id: The Guild ID that the template sourced from. :ivar Guild serialized_source_guild: A partial Guild object from the sourced template. - :ivar Optional[bool] is_dirty?: A status that denotes if the changes are unsynced. + :ivar Optional[bool] is_dirty: A status that denotes if the changes are unsynced. """ code: str = field() @@ -2430,7 +2430,7 @@ class EventMetadata(DictSerializerMixin): """ A class object representing the metadata of an event entity. - :ivar Optional[str] location?: The location of the event, if any. + :ivar Optional[str] location: The location of the event, if any. """ location: Optional[str] = field(default=None) @@ -2447,18 +2447,18 @@ class ScheduledEvents(DictSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the scheduled event. :ivar Snowflake guild_id: The ID of the guild that this scheduled event belongs to. - :ivar Optional[Snowflake] channel_id?: The channel ID in which the scheduled event belongs to, if any. - :ivar Optional[Snowflake] creator_id?: The ID of the user that created the scheduled event. + :ivar Optional[Snowflake] channel_id: The channel ID in which the scheduled event belongs to, if any. + :ivar Optional[Snowflake] creator_id: The ID of the user that created the scheduled event. :ivar str name: The name of the scheduled event. :ivar str description: The description of the scheduled event. - :ivar datetime scheduled_start_time?: The scheduled event start time. - :ivar Optional[datetime] scheduled_end_time?: The scheduled event end time, if any. + :ivar datetime scheduled_start_time: The scheduled event start time. + :ivar Optional[datetime] scheduled_end_time: The scheduled event end time, if any. :ivar int privacy_level: The privacy level of the scheduled event. :ivar int entity_type: The type of the scheduled event. - :ivar Optional[Snowflake] entity_id?: The ID of the entity associated with the scheduled event. - :ivar Optional[EventMetadata] entity_metadata?: Additional metadata associated with the scheduled event. - :ivar Optional[User] creator?: The user that created the scheduled event. - :ivar Optional[int] user_count?: The number of users subscribed to the scheduled event. + :ivar Optional[Snowflake] entity_id: The ID of the entity associated with the scheduled event. + :ivar Optional[EventMetadata] entity_metadata: Additional metadata associated with the scheduled event. + :ivar Optional[User] creator: The user that created the scheduled event. + :ivar Optional[int] user_count: The number of users subscribed to the scheduled event. :ivar int status: The status of the scheduled event :ivar Optional[str] image: The hash containing the image of an event, if applicable. """ diff --git a/interactions/api/models/gw.py b/interactions/api/models/gw.py index b11966690..87c48ffb8 100644 --- a/interactions/api/models/gw.py +++ b/interactions/api/models/gw.py @@ -237,15 +237,15 @@ class GuildMember(ClientSerializerMixin): A class object representing the gateway events ``GUILD_MEMBER_ADD``, ``GUILD_MEMBER_UPDATE`` and ``GUILD_MEMBER_REMOVE``. :ivar Snowflake guild_id: The guild ID of the event. - :ivar Optional[List[Role]] roles?: The roles of the event. - :ivar Optional[User] user?: The user of the event. - :ivar Optional[str] nick?: The nickname of the user of the event. - :ivar Optional[str] avatar?: The avatar URL of the user of the event. - :ivar Optional[datetime] joined_at?: The time that the user of the event joined at. - :ivar Optional[datetime] premium_since?: The time that the user of the event has since had "premium." - :ivar Optional[bool] deaf?: Whether the member of the event is deafened or not. - :ivar Optional[bool] mute?: Whether the member of the event is muted or not. - :ivar Optional[bool] pending?: Whether the member of the event is still pending -- pass membership screening -- or not. + :ivar Optional[List[Role]] roles: The roles of the event. + :ivar Optional[User] user: The user of the event. + :ivar Optional[str] nick: The nickname of the user of the event. + :ivar Optional[str] avatar: The avatar URL of the user of the event. + :ivar Optional[datetime] joined_at: The time that the user of the event joined at. + :ivar Optional[datetime] premium_since: The time that the user of the event has since had "premium." + :ivar Optional[bool] deaf: Whether the member of the event is deafened or not. + :ivar Optional[bool] mute: Whether the member of the event is muted or not. + :ivar Optional[bool] pending: Whether the member of the event is still pending -- pass membership screening -- or not. """ guild_id: Snowflake = field(converter=Snowflake) @@ -304,9 +304,9 @@ async def ban( """ Bans the member from a guild. - :param reason?: The reason of the ban + :param reason: The reason of the ban :type reason: Optional[str] - :param delete_message_days?: Number of days to delete messages, from 0 to 7. Defaults to 0 + :param delete_message_days: Number of days to delete messages, from 0 to 7. Defaults to 0 :type delete_message_days: Optional[int] """ await self._client.create_guild_ban( @@ -323,7 +323,7 @@ async def kick( """ Kicks the member from a guild. - :param reason?: The reason for the kick + :param reason: The reason for the kick :type reason: Optional[str] """ if not self._client: @@ -344,7 +344,7 @@ async def add_role( :param role: The role to add. Either ``Role`` object or role_id :type role: Union[Role, int] - :param reason?: The reason why the roles are added + :param reason: The reason why the roles are added :type reason: Optional[str] """ if not self._client: @@ -374,7 +374,7 @@ async def remove_role( :param role: The role to remove. Either ``Role`` object or role_id :type role: Union[Role, int] - :param reason?: The reason why the roles are removed + :param reason: The reason why the roles are removed :type reason: Optional[str] """ if not self._client: @@ -416,17 +416,17 @@ async def send( """ Sends a DM to the member. - :param content?: The contents of the message as a string or string-converted value. + :param content: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param components?: A component, or list of components for the message. + :param components: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[Actionrow], List[Button], List[SelectMenu]]] - :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param files?: A file or list of files to be attached to the message. + :param files: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param embeds?: An embed, or list of embeds for the message. + :param embeds: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions?: The message interactions/mention limits that the message can refer to. + :param allowed_mentions: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] :return: The sent message as an object. :rtype: Message @@ -488,19 +488,19 @@ async def modify( """ Modifies the member of a guild. - :param nick?: The nickname of the member + :param nick: The nickname of the member :type nick: Optional[str] - :param roles?: A list of all role ids the member has + :param roles: A list of all role ids the member has :type roles: Optional[List[int]] - :param mute?: whether the user is muted in voice channels + :param mute: whether the user is muted in voice channels :type mute: Optional[bool] - :param deaf?: whether the user is deafened in voice channels + :param deaf: whether the user is deafened in voice channels :type deaf: Optional[bool] - :param channel_id?: id of channel to move user to (if they are connected to voice) + :param channel_id: id of channel to move user to (if they are connected to voice) :type channel_id: Optional[int] - :param communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) + :param communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) :type communication_disabled_until: Optional[datetime.isoformat] - :param reason?: The reason of the modifying + :param reason: The reason of the modifying :type reason: Optional[str] :return: The modified member object :rtype: Member @@ -585,7 +585,7 @@ class GuildRole(ClientSerializerMixin): :ivar Snowflake guild_id: The guild ID of the event. :ivar Optional[Role] role: The role of the event. - :ivar Optional[Snowflake] role_id?: The role ID of the event. + :ivar Optional[Snowflake] role_id: The role ID of the event. """ guild_id: Snowflake = field(converter=Snowflake) @@ -618,18 +618,18 @@ class GuildScheduledEvent(ClientSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the scheduled event. :ivar Snowflake guild_id: The ID of the guild that this scheduled event belongs to. - :ivar Optional[Snowflake] channel_id?: The channel ID in which the scheduled event belongs to, if any. - :ivar Optional[Snowflake] creator_id?: The ID of the user that created the scheduled event. + :ivar Optional[Snowflake] channel_id: The channel ID in which the scheduled event belongs to, if any. + :ivar Optional[Snowflake] creator_id: The ID of the user that created the scheduled event. :ivar str name: The name of the scheduled event. :ivar str description: The description of the scheduled event. - :ivar datetime scheduled_start_time?: The scheduled event start time. - :ivar Optional[datetime] scheduled_end_time?: The scheduled event end time, if any. + :ivar datetime scheduled_start_time: The scheduled event start time. + :ivar Optional[datetime] scheduled_end_time: The scheduled event end time, if any. :ivar int privacy_level: The privacy level of the scheduled event. :ivar int entity_type: The type of the scheduled event. - :ivar Optional[Snowflake] entity_id?: The ID of the entity associated with the scheduled event. - :ivar Optional[EventMetadata] entity_metadata?: Additional metadata associated with the scheduled event. - :ivar Optional[User] creator?: The user that created the scheduled event. - :ivar Optional[int] user_count?: The number of users subscribed to the scheduled event. + :ivar Optional[Snowflake] entity_id: The ID of the entity associated with the scheduled event. + :ivar Optional[EventMetadata] entity_metadata: Additional metadata associated with the scheduled event. + :ivar Optional[User] creator: The user that created the scheduled event. + :ivar Optional[int] user_count: The number of users subscribed to the scheduled event. :ivar int status: The status of the scheduled event :ivar Optional[str] image: The hash containing the image of an event, if applicable. """ @@ -760,12 +760,12 @@ class MessageReaction(DictSerializerMixin): """ A class object representing the gateway event ``MESSAGE_REACTION_ADD``. - :ivar Optional[Snowflake] user_id?: The user ID of the event. + :ivar Optional[Snowflake] user_id: The user ID of the event. :ivar Snowflake channel_id: The channel ID of the event. :ivar Snowflake message_id: The message ID of the event. - :ivar Optional[Snowflake] guild_id?: The guild ID of the event. - :ivar Optional[Member] member?: The member of the event. - :ivar Optional[Emoji] emoji?: The emoji of the event. + :ivar Optional[Snowflake] guild_id: The guild ID of the event. + :ivar Optional[Member] member: The member of the event. + :ivar Optional[Emoji] emoji: The emoji of the event. """ user_id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -784,11 +784,11 @@ class ReactionRemove(MessageReaction): This class inherits the already existing attributes of :class:`interactions.api.models.gw.Reaction`. The main missing attribute is ``member``. - :ivar Optional[Snowflake] user_id?: The user ID of the event. + :ivar Optional[Snowflake] user_id: The user ID of the event. :ivar Snowflake channel_id: The channel ID of the event. :ivar Snowflake message_id: The message ID of the event. - :ivar Optional[Snowflake] guild_id?: The guild ID of the event. - :ivar Optional[Emoji] emoji?: The emoji of the event. + :ivar Optional[Snowflake] guild_id: The guild ID of the event. + :ivar Optional[Emoji] emoji: The emoji of the event. """ # todo see if the missing member attribute affects anything @@ -800,7 +800,7 @@ class ThreadList(DictSerializerMixin): A class object representing the gateway event ``THREAD_LIST_SYNC``. :ivar Snowflake guild_id: The guild ID of the event. - :ivar Optional[List[Snowflake]] channel_ids?: The channel IDs of the event. + :ivar Optional[List[Snowflake]] channel_ids: The channel IDs of the event. :ivar List[Channel] threads: The threads of the event. :ivar List[ThreadMember] members: The members of the thread of the event. """ @@ -819,8 +819,8 @@ class ThreadMembers(DictSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the event. :ivar Snowflake guild_id: The guild ID of the event. :ivar int member_count: The member count of the event. - :ivar Optional[List[ThreadMember]] added_members?: The added members of the thread of the event. - :ivar Optional[List[Snowflake]] removed_member_ids?: The removed IDs of members of the thread of the event. + :ivar Optional[List[ThreadMember]] added_members: The added members of the thread of the event. + :ivar Optional[List[Snowflake]] removed_member_ids: The removed IDs of members of the thread of the event. """ id: Snowflake = field(converter=Snowflake) diff --git a/interactions/api/models/member.py b/interactions/api/models/member.py index d061f46dc..ef9901de9 100644 --- a/interactions/api/models/member.py +++ b/interactions/api/models/member.py @@ -29,15 +29,15 @@ class Member(ClientSerializerMixin, IDMixin): :ivar User user: The user of the guild. :ivar str nick: The nickname of the member. - :ivar Optional[str] avatar?: The hash containing the user's guild avatar, if applicable. + :ivar Optional[str] avatar: The hash containing the user's guild avatar, if applicable. :ivar List[Role] roles: The list of roles of the member. :ivar datetime joined_at: The timestamp the member joined the guild at. :ivar datetime premium_since: The timestamp the member has been a server booster since. :ivar bool deaf: Whether the member is deafened. :ivar bool mute: Whether the member is muted. - :ivar Optional[bool] pending?: Whether the member is pending to pass membership screening. - :ivar Optional[Permissions] permissions?: Whether the member has permissions. - :ivar Optional[str] communication_disabled_until?: How long until they're unmuted, if any. + :ivar Optional[bool] pending: Whether the member is pending to pass membership screening. + :ivar Optional[Permissions] permissions: Whether the member has permissions. + :ivar Optional[str] communication_disabled_until: How long until they're unmuted, if any. """ user: Optional[User] = field(converter=User, default=None, add_client=True, repr=True) @@ -107,9 +107,9 @@ async def ban( :param guild_id: The id of the guild to ban the member from :type guild_id: Union[int, Snowflake, "Guild"] - :param reason?: The reason of the ban + :param reason: The reason of the ban :type reason: Optional[str] - :param delete_message_days?: Number of days to delete messages, from 0 to 7. Defaults to 0 + :param delete_message_days: Number of days to delete messages, from 0 to 7. Defaults to 0 :type delete_message_days: Optional[int] """ @@ -132,7 +132,7 @@ async def kick( :param guild_id: The id of the guild to kick the member from :type guild_id: Union[int, Snowflake, "Guild"] - :param reason?: The reason for the kick + :param reason: The reason for the kick :type reason: Optional[str] """ if not self._client: @@ -159,7 +159,7 @@ async def add_role( :type role: Union[Role, int, Snowflake] :param guild_id: The id of the guild to add the roles to the member :type guild_id: Union[int, Snowflake, "Guild"] - :param reason?: The reason why the roles are added + :param reason: The reason why the roles are added :type reason: Optional[str] """ if not self._client: @@ -188,7 +188,7 @@ async def remove_role( :type role: Union[Role, int] :param guild_id: The id of the guild to remove the roles of the member :type guild_id: Union[int, Snowflake, "Guild"] - :param reason?: The reason why the roles are removed + :param reason: The reason why the roles are removed :type reason: Optional[str] """ if not self._client: @@ -227,19 +227,19 @@ async def send( """ Sends a DM to the member. - :param content?: The contents of the message as a string or string-converted value. + :param content: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param components?: A component, or list of components for the message. + :param components: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] - :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param files?: A file or list of files to be attached to the message. + :param files: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param embeds?: An embed, or list of embeds for the message. + :param embeds: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions?: The message interactions/mention limits that the message can refer to. + :param allowed_mentions: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] :return: The sent message as an object. :rtype: Message @@ -304,19 +304,19 @@ async def modify( :param guild_id: The id of the guild to modify the member on :type guild_id: Union[int, Snowflake, "Guild"] - :param nick?: The nickname of the member + :param nick: The nickname of the member :type nick: Optional[str] - :param roles?: A list of all role ids the member has + :param roles: A list of all role ids the member has :type roles: Optional[List[int]] - :param mute?: whether the user is muted in voice channels + :param mute: whether the user is muted in voice channels :type mute: Optional[bool] - :param deaf?: whether the user is deafened in voice channels + :param deaf: whether the user is deafened in voice channels :type deaf: Optional[bool] - :param channel_id?: id of channel to move user to (if they are connected to voice) + :param channel_id: id of channel to move user to (if they are connected to voice) :type channel_id: Optional[Union[Channel, int, Snowflake]] - :param communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) + :param communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) :type communication_disabled_until: Optional[datetime.isoformat] - :param reason?: The reason of the modifying + :param reason: The reason of the modifying :type reason: Optional[str] :return: The modified member object :rtype: Member diff --git a/interactions/api/models/message.py b/interactions/api/models/message.py index 4167c1bd0..ef71e40a0 100644 --- a/interactions/api/models/message.py +++ b/interactions/api/models/message.py @@ -87,7 +87,7 @@ class MessageActivity(DictSerializerMixin): i.e. : Phasmophobia and Call of Duty. :ivar str type: The message activity type. - :ivar Optional[Snowflake] party_id?: The party ID of the activity. + :ivar Optional[Snowflake] party_id: The party ID of the activity. """ type: int = field() @@ -103,10 +103,10 @@ class MessageReference(DictSerializerMixin): All of the attributes in this class are optionals because a message can potentially never be referenced. - :ivar Optional[Snowflake] message_id?: The ID of the referenced message. - :ivar Optional[Snowflake] channel_id?: The channel ID of the referenced message. - :ivar Optional[Snowflake] guild_id?: The guild ID of the referenced message. - :ivar Optional[bool] fail_if_not_exists?: Whether the message reference exists. + :ivar Optional[Snowflake] message_id: The ID of the referenced message. + :ivar Optional[Snowflake] channel_id: The channel ID of the referenced message. + :ivar Optional[Snowflake] guild_id: The guild ID of the referenced message. + :ivar Optional[bool] fail_if_not_exists: Whether the message reference exists. """ message_id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -130,13 +130,13 @@ class Attachment(ClientSerializerMixin, IDMixin): :ivar int id: The ID of the attachment. :ivar str filename: The name of the attachment file. - :ivar Optional[str] description?: The description of the file. - :ivar Optional[str] content_type?: The type of attachment file. + :ivar Optional[str] description: The description of the file. + :ivar Optional[str] content_type: The type of attachment file. :ivar int size: The size of the attachment file. :ivar str url: The CDN URL of the attachment file. :ivar str proxy_url: The proxied/cached CDN URL of the attachment file. - :ivar Optional[int] height?: The height of the attachment file. - :ivar Optional[int] width?: The width of the attachment file. + :ivar Optional[int] height: The height of the attachment file. + :ivar Optional[int] width: The width of the attachment file. :ivar Optional[bool] ephemeral: Whether the attachment is ephemeral. """ @@ -193,14 +193,14 @@ class Emoji(ClientSerializerMixin): """ A class objecting representing an emoji. - :ivar Optional[Snowflake] id?: Emoji id - :ivar Optional[str] name?: Emoji name. - :ivar Optional[List[Role]] roles?: Roles allowed to use this emoji - :ivar Optional[User] user?: User that created this emoji - :ivar Optional[bool] require_colons?: Status denoting of this emoji must be wrapped in colons - :ivar Optional[bool] managed?: Status denoting if this emoji is managed (by an integration) - :ivar Optional[bool] animated?: Status denoting if this emoji is animated - :ivar Optional[bool] available?: Status denoting if this emoji can be used. (Can be false via server boosting) + :ivar Optional[Snowflake] id: Emoji id + :ivar Optional[str] name: Emoji name. + :ivar Optional[List[Role]] roles: Roles allowed to use this emoji + :ivar Optional[User] user: User that created this emoji + :ivar Optional[bool] require_colons: Status denoting of this emoji must be wrapped in colons + :ivar Optional[bool] managed: Status denoting if this emoji is managed (by an integration) + :ivar Optional[bool] animated: Status denoting if this emoji is animated + :ivar Optional[bool] available: Status denoting if this emoji can be used. (Can be false via server boosting) """ id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -269,8 +269,8 @@ async def delete( :param guild_id: The guild id to delete the emoji from :type guild_id: Union[int, Snowflake, "Guild"] - :param reason?: The reason of the deletion - :type reason?: Optional[str] + :param reason: The reason of the deletion + :type reason: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -310,9 +310,9 @@ class EmbedImageStruct(DictSerializerMixin): ) :ivar str url: Source URL of the object. - :ivar Optional[str] proxy_url?: Proxied url of the object. - :ivar Optional[int] height?: Height of the object. - :ivar Optional[int] width?: Width of the object. + :ivar Optional[str] proxy_url: Proxied url of the object. + :ivar Optional[int] height: Height of the object. + :ivar Optional[int] width: Width of the object. """ url: str = field() @@ -337,8 +337,8 @@ class EmbedProvider(DictSerializerMixin): """ A class object representing the provider of an embed. - :ivar Optional[str] name?: Name of provider - :ivar Optional[str] url?: URL of provider + :ivar Optional[str] name: Name of provider + :ivar Optional[str] url: URL of provider """ name: Optional[str] = field(default=None) @@ -370,9 +370,9 @@ class EmbedAuthor(DictSerializerMixin): ) :ivar str name: Name of author - :ivar Optional[str] url?: URL of author - :ivar Optional[str] icon_url?: URL of author icon - :ivar Optional[str] proxy_icon_url?: Proxied URL of author icon + :ivar Optional[str] url: URL of author + :ivar Optional[str] icon_url: URL of author icon + :ivar Optional[str] proxy_icon_url: Proxied URL of author icon """ name: str = field() @@ -406,8 +406,8 @@ class EmbedFooter(DictSerializerMixin): ) :ivar str text: Footer text - :ivar Optional[str] icon_url?: URL of footer icon - :ivar Optional[str] proxy_icon_url?: Proxied URL of footer icon + :ivar Optional[str] icon_url: URL of footer icon + :ivar Optional[str] proxy_icon_url: Proxied URL of footer icon """ text: str = field() @@ -443,7 +443,7 @@ class EmbedField(DictSerializerMixin): :ivar str name: Name of the field. :ivar str value: Value of the field - :ivar Optional[bool] inline?: A status denoting if the field should be displayed inline. + :ivar Optional[bool] inline: A status denoting if the field should be displayed inline. """ name: str = field() @@ -482,19 +482,19 @@ class Embed(DictSerializerMixin): fields=[interaction.EmbedField(...)], ) - :ivar Optional[str] title?: Title of embed - :ivar Optional[str] type?: Embed type, relevant by CDN file connected. This is only important to rendering. - :ivar Optional[str] description?: Embed description - :ivar Optional[str] url?: URL of embed - :ivar Optional[datetime] timestamp?: Timestamp of embed content - :ivar Optional[int] color?: Color code of embed - :ivar Optional[EmbedFooter] footer?: Footer information - :ivar Optional[EmbedImageStruct] image?: Image information - :ivar Optional[EmbedImageStruct] thumbnail?: Thumbnail information - :ivar Optional[EmbedImageStruct] video?: Video information - :ivar Optional[EmbedProvider] provider?: Provider information - :ivar Optional[EmbedAuthor] author?: Author information - :ivar Optional[List[EmbedField]] fields?: A list of fields denoting field information + :ivar Optional[str] title: Title of embed + :ivar Optional[str] type: Embed type, relevant by CDN file connected. This is only important to rendering. + :ivar Optional[str] description: Embed description + :ivar Optional[str] url: URL of embed + :ivar Optional[datetime] timestamp: Timestamp of embed content + :ivar Optional[int] color: Color code of embed + :ivar Optional[EmbedFooter] footer: Footer information + :ivar Optional[EmbedImageStruct] image: Image information + :ivar Optional[EmbedImageStruct] thumbnail: Thumbnail information + :ivar Optional[EmbedImageStruct] video: Video information + :ivar Optional[EmbedProvider] provider: Provider information + :ivar Optional[EmbedAuthor] author: Author information + :ivar Optional[List[EmbedField]] fields: A list of fields denoting field information """ title: Optional[str] = field(default=None) @@ -543,8 +543,8 @@ def add_field(self, name: str, value: str, inline: Optional[bool] = False) -> No :type name: str :param value: The value of the field :type value: str - :param inline?: if the field is in the same line as the previous one - :type inline?: Optional[bool] + :param inline: if the field is in the same line as the previous one + :type inline: Optional[bool] """ fields = self.fields or [] @@ -574,8 +574,8 @@ def insert_field_at( :type name: str :param value: The value of the field :type value: str - :param inline?: if the field is in the same line as the previous one - :type inline?: Optional[bool] + :param inline: if the field is in the same line as the previous one + :type inline: Optional[bool] """ def set_field_at( @@ -590,8 +590,8 @@ def set_field_at( :type name: str :param value: The value of the field :type value: str - :param inline?: if the field is in the same line as the previous one - :type inline?: Optional[bool] + :param inline: if the field is in the same line as the previous one + :type inline: Optional[bool] """ try: @@ -642,12 +642,12 @@ def set_author( :param name: The name of the author :type name: str - :param url?: Url of author - :type url?: Optional[str] - :param icon_url?: Url of author icon (only supports http(s) and attachments) - :type icon_url?: Optional[str] - :param proxy_icon_url?: A proxied url of author icon - :type proxy_icon_url?: Optional[str] + :param url: Url of author + :type url: Optional[str] + :param icon_url: Url of author icon (only supports http(s) and attachments) + :type icon_url: Optional[str] + :param proxy_icon_url: A proxied url of author icon + :type proxy_icon_url: Optional[str] """ self.author = EmbedAuthor( @@ -662,10 +662,10 @@ def set_footer( :param text: The text of the footer :type text: str - :param icon_url?: Url of footer icon (only supports http(s) and attachments) - :type icon_url?: Optional[str] - :param proxy_icon_url?: A proxied url of footer icon - :type proxy_icon_url?: Optional[str] + :param icon_url: Url of footer icon (only supports http(s) and attachments) + :type icon_url: Optional[str] + :param proxy_icon_url: A proxied url of footer icon + :type proxy_icon_url: Optional[str] """ self.footer = EmbedFooter(text=text, icon_url=icon_url, proxy_icon_url=proxy_icon_url) @@ -682,12 +682,12 @@ def set_image( :param url: Url of the image :type url: str - :param proxy_url?: A proxied url of the image - :type proxy_url?: Optional[str] - :param height?: The image's height - :type height?: Optional[int] - :param width?: The image's width - :type width?: Optional[int] + :param proxy_url: A proxied url of the image + :type proxy_url: Optional[str] + :param height: The image's height + :type height: Optional[int] + :param width: The image's width + :type width: Optional[int] """ self.image = EmbedImageStruct(url=url, proxy_url=proxy_url, height=height, width=width) @@ -704,12 +704,12 @@ def set_video( :param url: Url of the video :type url: str - :param proxy_url?: A proxied url of the video - :type proxy_url?: Optional[str] - :param height?: The video's height - :type height?: Optional[int] - :param width?: The video's width - :type width?: Optional[int] + :param proxy_url: A proxied url of the video + :type proxy_url: Optional[str] + :param height: The video's height + :type height: Optional[int] + :param width: The video's width + :type width: Optional[int] """ self.video = EmbedImageStruct(url=url, proxy_url=proxy_url, height=height, width=width) @@ -726,12 +726,12 @@ def set_thumbnail( :param url: Url of the thumbnail :type url: str - :param proxy_url?: A proxied url of the thumbnail - :type proxy_url?: Optional[str] - :param height?: The thumbnail's height - :type height?: Optional[int] - :param width?: The thumbnail's width - :type width?: Optional[int] + :param proxy_url: A proxied url of the thumbnail + :type proxy_url: Optional[str] + :param height: The thumbnail's height + :type height: Optional[int] + :param width: The thumbnail's width + :type width: Optional[int] """ self.thumbnail = EmbedImageStruct(url=url, proxy_url=proxy_url, height=height, width=width) @@ -758,17 +758,17 @@ class Sticker(PartialSticker, IDMixin): A class object representing a full sticker apart from a partial. :ivar Snowflake id: ID of the sticker - :ivar Optional[Snowflake] pack_id?: ID of the pack the sticker is from. + :ivar Optional[Snowflake] pack_id: ID of the pack the sticker is from. :ivar str name: Name of the sticker - :ivar Optional[str] description?: Description of the sticker + :ivar Optional[str] description: Description of the sticker :ivar str tags: Autocomplete/suggestion tags for the sticker (max 200 characters) :ivar str asset: Previously a sticker asset hash, now an empty string. :ivar int type: Type of sticker :ivar int format_type: Type of sticker format - :ivar Optional[bool] available?: Status denoting if this sticker can be used. (Can be false via server boosting) - :ivar Optional[Snowflake] guild_id?: Guild ID that owns the sticker. - :ivar Optional[User] user?: The user that uploaded the sticker. - :ivar Optional[int] sort_value?: The standard sticker's sort order within its pack + :ivar Optional[bool] available: Status denoting if this sticker can be used. (Can be false via server boosting) + :ivar Optional[Snowflake] guild_id: Guild ID that owns the sticker. + :ivar Optional[User] user: The user that uploaded the sticker. + :ivar Optional[int] sort_value: The standard sticker's sort order within its pack """ id: Snowflake = field(converter=Snowflake) @@ -806,34 +806,34 @@ class Message(ClientSerializerMixin, IDMixin): :ivar Snowflake id: ID of the message. :ivar Snowflake channel_id: ID of the channel the message was sent in - :ivar Optional[Snowflake] guild_id?: ID of the guild the message was sent in, if it exists. + :ivar Optional[Snowflake] guild_id: ID of the guild the message was sent in, if it exists. :ivar User author: The author of the message. - :ivar Optional[Member] member?: The member object associated with the author, if any. + :ivar Optional[Member] member: The member object associated with the author, if any. :ivar str content: Message contents. :ivar datetime timestamp: Timestamp denoting when the message was sent. - :ivar Optional[datetime] edited_timestamp?: Timestamp denoting when the message was edited, if any. + :ivar Optional[datetime] edited_timestamp: Timestamp denoting when the message was edited, if any. :ivar bool tts: Status dictating if this was a TTS message or not. :ivar bool mention_everyone: Status dictating of this message mentions everyone - :ivar Optional[List[Union[Member, User]]] mentions?: Array of user objects with an additional partial member field. - :ivar Optional[List[str]] mention_roles?: Array of roles mentioned in this message - :ivar Optional[List[ChannelMention]] mention_channels?: Channels mentioned in this message, if any. + :ivar Optional[List[Union[Member, User]]] mentions: Array of user objects with an additional partial member field. + :ivar Optional[List[str]] mention_roles: Array of roles mentioned in this message + :ivar Optional[List[ChannelMention]] mention_channels: Channels mentioned in this message, if any. :ivar List[Attachment] attachments: An array of attachments :ivar List[Embed] embeds: An array of embeds - :ivar Optional[List[ReactionObject]] reactions?: Reactions to the message. + :ivar Optional[List[ReactionObject]] reactions: Reactions to the message. :ivar Union[int, str] nonce: Used for message validation :ivar bool pinned: Whether this message is pinned. - :ivar Optional[Snowflake] webhook_id?: Webhook ID if the message is generated by a webhook. + :ivar Optional[Snowflake] webhook_id: Webhook ID if the message is generated by a webhook. :ivar MessageType type: Type of message - :ivar Optional[MessageActivity] activity?: Message activity object that's sent by Rich Presence - :ivar Optional[Application] application?: Application object that's sent by Rich Presence - :ivar Optional[MessageReference] message_reference?: Data showing the source of a message (crosspost, channel follow, add, pin, or replied message) + :ivar Optional[MessageActivity] activity: Message activity object that's sent by Rich Presence + :ivar Optional[Application] application: Application object that's sent by Rich Presence + :ivar Optional[MessageReference] message_reference: Data showing the source of a message (crosspost, channel follow, add, pin, or replied message) :ivar Optional[Any] allowed_mentions: The allowed mentions of roles attached in the message. :ivar int flags: Message flags - :ivar Optional[MessageInteraction] interaction?: Message interaction object, if the message is sent by an interaction. - :ivar Optional[Channel] thread?: The thread that started from this message, if any, with a thread member object embedded. - :ivar Optional[Union[Component, List[Component]]] components?: Components associated with this message, if any. - :ivar Optional[List[PartialSticker]] sticker_items?: An array of message sticker item objects, if sent with them. - :ivar Optional[List[Sticker]] stickers?: Array of sticker objects sent with the message if any. Deprecated. + :ivar Optional[MessageInteraction] interaction: Message interaction object, if the message is sent by an interaction. + :ivar Optional[Channel] thread: The thread that started from this message, if any, with a thread member object embedded. + :ivar Optional[Union[Component, List[Component]]] components: Components associated with this message, if any. + :ivar Optional[List[PartialSticker]] sticker_items: An array of message sticker item objects, if sent with them. + :ivar Optional[List[Sticker]] stickers: Array of sticker objects sent with the message if any. Deprecated. """ id: Snowflake = field(converter=Snowflake) @@ -950,21 +950,21 @@ async def edit( """ This method edits a message. Only available for messages sent by the bot. - :param content?: The contents of the message as a string or string-converted value. + :param content: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param files?: A file or list of files to be attached to the message. + :param files: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param embeds?: An embed, or list of embeds for the message. + :param embeds: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param suppress_embeds?: Whether to suppress embeds in the message. + :param suppress_embeds: Whether to suppress embeds in the message. :type suppress_embeds: Optional[bool] - :param allowed_mentions?: The message interactions/mention limits that the message can refer to. + :param allowed_mentions: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] - :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param components?: A component, or list of components for the message. If `[]` the components will be removed + :param components: A component, or list of components for the message. If `[]` the components will be removed :type components: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] :return: The edited message as an object. :rtype: Message @@ -1064,21 +1064,21 @@ async def reply( """ Sends a new message replying to the old. - :param content?: The contents of the message as a string or string-converted value. + :param content: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param files?: A file or list of files to be attached to the message. + :param files: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param embeds?: An embed, or list of embeds for the message. + :param embeds: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions?: The message interactions/mention limits that the message can refer to. + :param allowed_mentions: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] - :param components?: A component, or list of components for the message. + :param components: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] - :param stickers?: A list of stickers to send with your message. You can send up to 3 stickers per message. + :param stickers: A list of stickers to send with your message. You can send up to 3 stickers per message. :type stickers: Optional[List[Sticker]] :return: The sent message as an object. :rtype: Message @@ -1175,12 +1175,12 @@ async def create_thread( :param name: The name of the thread :type name: str - :param auto_archive_duration?: duration in minutes to automatically archive the thread after recent activity, + :param auto_archive_duration: duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param invitable?: Boolean to display if the Thread is open to join or private. + :param invitable: Boolean to display if the Thread is open to join or private. :type invitable: Optional[bool] - :param reason?: An optional reason for the audit log + :param reason: An optional reason for the audit log :type reason: Optional[str] :return: The created thread :rtype: Channel diff --git a/interactions/api/models/misc.py b/interactions/api/models/misc.py index ec3ced211..4af73d891 100644 --- a/interactions/api/models/misc.py +++ b/interactions/api/models/misc.py @@ -58,9 +58,9 @@ class ClientStatus(DictSerializerMixin): """ An object that symbolizes the status per client device per session. - :ivar Optional[str] desktop?: User's status set for an active desktop application session - :ivar Optional[str] mobile?: User's status set for an active mobile application session - :ivar Optional[str] web?: User's status set for an active web application session + :ivar Optional[str] desktop: User's status set for an active desktop application session + :ivar Optional[str] mobile: User's status set for an active mobile application session + :ivar Optional[str] web: User's status set for an active web application session """ desktop: Optional[str] = field(default=None) diff --git a/interactions/api/models/presence.py b/interactions/api/models/presence.py index ad01dde18..6de1747fa 100644 --- a/interactions/api/models/presence.py +++ b/interactions/api/models/presence.py @@ -23,8 +23,8 @@ class PresenceParty(DictSerializerMixin): """ A class object representing the party data of a presence. - :ivar Optional[Snowflake] id?: ID of the party. - :ivar Optional[List[int]] size?: An array denoting the party's current and max size + :ivar Optional[Snowflake] id: ID of the party. + :ivar Optional[List[int]] size: An array denoting the party's current and max size """ id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -36,10 +36,10 @@ class PresenceAssets(DictSerializerMixin): """ A class object representing the assets of a presence. - :ivar Optional[str] large_image?: ID for a large asset of the activity - :ivar Optional[str] large_text?: Text associated with the large asset - :ivar Optional[str] small_image?: ID for a small asset of the activity - :ivar Optional[str] small_text?: Text associated with the small asset + :ivar Optional[str] large_image: ID for a large asset of the activity + :ivar Optional[str] large_text: Text associated with the large asset + :ivar Optional[str] small_image: ID for a small asset of the activity + :ivar Optional[str] small_text: Text associated with the small asset """ large_image: Optional[str] = field(default=None) @@ -53,9 +53,9 @@ class PresenceSecrets(DictSerializerMixin): """ A class object representing "secret" join information of a presence. - :ivar Optional[str] join?: Join secret - :ivar Optional[str] spectate?: Spectate secret - :ivar Optional[str] match?: Instanced match secret + :ivar Optional[str] join: Join secret + :ivar Optional[str] spectate: Spectate secret + :ivar Optional[str] match: Instanced match secret """ join: Optional[str] = field(default=None) @@ -68,8 +68,8 @@ class PresenceTimestamp(DictSerializerMixin): """ A class object representing the timestamp data of a presence. - :ivar Optional[int] start?: Unix time in ms when the activity started - :ivar Optional[int] end?: Unix time in ms when the activity ended + :ivar Optional[int] start: Unix time in ms when the activity started + :ivar Optional[int] end: Unix time in ms when the activity ended """ start: Optional[int] = field(default=None) @@ -103,19 +103,19 @@ class PresenceActivity(DictSerializerMixin): :ivar str name: The activity name :ivar Union[int, PresenceActivityType] type: The activity type - :ivar Optional[str] url?: stream url (if type is 1) + :ivar Optional[str] url: stream url (if type is 1) :ivar int created_at: Unix timestamp (in milliseconds) of when the activity was added to the user's session - :ivar Optional[PresenceTimestamp] timestamps?: Unix timestamps for start and/or end of the game - :ivar Optional[Snowflake] application_id?: Application ID for the game - :ivar Optional[str] details?: What the player is currently doing - :ivar Optional[str] state?: Current party status - :ivar Optional[Emoji] emoji?: The emoji used for the custom status - :ivar Optional[PresenceParty] party?: Info for the current players' party - :ivar Optional[PresenceAssets] assets?: Images for the presence and their associated hover texts - :ivar Optional[PresenceSecrets] secrets?: for RPC join/spectate - :ivar Optional[bool] instance?: A status denoting if the activity is a game session - :ivar Optional[int] flags?: activity flags - :ivar Optional[List[str]] buttons?: Custom button labels shown in the status, if any. + :ivar Optional[PresenceTimestamp] timestamps: Unix timestamps for start and/or end of the game + :ivar Optional[Snowflake] application_id: Application ID for the game + :ivar Optional[str] details: What the player is currently doing + :ivar Optional[str] state: Current party status + :ivar Optional[Emoji] emoji: The emoji used for the custom status + :ivar Optional[PresenceParty] party: Info for the current players' party + :ivar Optional[PresenceAssets] assets: Images for the presence and their associated hover texts + :ivar Optional[PresenceSecrets] secrets: for RPC join/spectate + :ivar Optional[bool] instance: A status denoting if the activity is a game session + :ivar Optional[int] flags: activity flags + :ivar Optional[List[str]] buttons: Custom button labels shown in the status, if any. """ name: str = field() @@ -163,7 +163,7 @@ class ClientPresence(DictSerializerMixin): """ An object that symbolizes the presence of the current client's session upon creation. - :ivar Optional[int] since?: Unix time in milliseconds of when the client went idle. None if it is not idle. + :ivar Optional[int] since: Unix time in milliseconds of when the client went idle. None if it is not idle. :ivar Optional[List[PresenceActivity]] activities: Array of activity objects. :ivar Union[str, StatusType] status: The client's new status. :ivar bool afk: Whether the client is afk or not. diff --git a/interactions/api/models/role.py b/interactions/api/models/role.py index 05c49fe3c..4dd9b34fc 100644 --- a/interactions/api/models/role.py +++ b/interactions/api/models/role.py @@ -18,9 +18,9 @@ class RoleTags(DictSerializerMixin): """ A class object representing the tags of a role. - :ivar Optional[Snowflake] bot_id?: The id of the bot this role belongs to - :ivar Optional[Snowflake] integration_id?: The id of the integration this role belongs to - :ivar Optional[Any] premium_subscriber?: Whether if this is the guild's premium subscriber role + :ivar Optional[Snowflake] bot_id: The id of the bot this role belongs to + :ivar Optional[Snowflake] integration_id: The id of the integration this role belongs to + :ivar Optional[Any] premium_subscriber: Whether if this is the guild's premium subscriber role """ bot_id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -39,13 +39,13 @@ class Role(ClientSerializerMixin, IDMixin): :ivar str name: Role name :ivar int color: Role color in integer representation :ivar bool hoist: A status denoting if this role is hoisted - :ivar Optional[str] icon?: Role icon hash, if any. - :ivar Optional[str] unicode_emoji?: Role unicode emoji + :ivar Optional[str] icon: Role icon hash, if any. + :ivar Optional[str] unicode_emoji: Role unicode emoji :ivar int position: Role position :ivar str permissions: Role permissions as a bit set :ivar bool managed: A status denoting if this role is managed by an integration :ivar bool mentionable: A status denoting if this role is mentionable - :ivar Optional[RoleTags] tags?: The tags this role has + :ivar Optional[RoleTags] tags: The tags this role has """ id: Snowflake = field(converter=Snowflake) @@ -109,21 +109,21 @@ async def modify( :param guild_id: The id of the guild to edit the role on :type guild_id: int - :param name?: The name of the role, defaults to the current value of the role + :param name: The name of the role, defaults to the current value of the role :type name: Optional[str] - :param color?: RGB color value as integer, defaults to the current value of the role + :param color: RGB color value as integer, defaults to the current value of the role :type color: Optional[int] - :param permissions?: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role + :param permissions: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role :type permissions: Optional[int] - :param hoist?: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role + :param hoist: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role :type hoist: Optional[bool] - :param icon?: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role + :param icon: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role :type icon: Optional[Image] - :param unicode_emoji?: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role + :param unicode_emoji: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role :type unicode_emoji: Optional[str] - :param mentionable?: Whether the role should be mentionable, defaults to the current value of the role + :param mentionable: Whether the role should be mentionable, defaults to the current value of the role :type mentionable: Optional[bool] - :param reason?: The reason why the role is edited, default ``None`` + :param reason: The reason why the role is edited, default ``None`` :type reason: Optional[str] :return: The modified role object :rtype: Role @@ -173,7 +173,7 @@ async def modify_position( :type guild_id: int :param position: The new position of the role :type position: int - :param reason?: The reason for the modifying + :param reason: The reason for the modifying :type reason: Optional[str] :return: List of guild roles with updated hierarchy :rtype: List[Role] diff --git a/interactions/api/models/team.py b/interactions/api/models/team.py index e4bf3a827..ac4fa89d8 100644 --- a/interactions/api/models/team.py +++ b/interactions/api/models/team.py @@ -38,7 +38,7 @@ class Team(ClientSerializerMixin, IDMixin): """ A class object representing a team. - :ivar Optional[str] icon?: The hash of the team's icon + :ivar Optional[str] icon: The hash of the team's icon :ivar Snowflake id: The team's unique ID :ivar List[TeamMember] members: The members of the team :ivar str name: The team name @@ -62,22 +62,22 @@ class Application(ClientSerializerMixin, IDMixin): :ivar Snowflake id: Application ID :ivar str name: Application Name - :ivar Optional[str] icon?: Icon hash of the application + :ivar Optional[str] icon: Icon hash of the application :ivar str description: Application Description - :ivar Optional[List[str]] rpc_origins?: An array of rpc origin urls, if RPC is used. + :ivar Optional[List[str]] rpc_origins: An array of rpc origin urls, if RPC is used. :ivar bool bot_public: A status denoting if anyone can invite the bot to guilds :ivar bool bot_require_code_grant: A status denoting whether full Oauth2 is required for the app's bot to join a guild - :ivar Optional[str] terms_of_service_url?: URL of the app's Terms of Service - :ivar Optional[str] privacy_policy_url?: URL of the app's Privacy Policy - :ivar Optional[User] owner?: User object of the owner + :ivar Optional[str] terms_of_service_url: URL of the app's Terms of Service + :ivar Optional[str] privacy_policy_url: URL of the app's Privacy Policy + :ivar Optional[User] owner: User object of the owner :ivar str summary: Summary of the store page, if this application is a game sold on Discord :ivar str verify_key: Hex encoded key for verification in interactions and/or the GameSDK's GetTicket - :ivar Optional[Team] team?: A list of team members, if this app belongs to a team. - :ivar Optional[Snowflake] guild_id?: Guild ID linked, if this app is a game sold on Discord - :ivar Optional[int] primary_sku_id?: Game SKU ID, if this app is a game sold on Discord - :ivar Optional[str] slug?: URL slug that links to the store page, if this app is a game sold on Discord - :ivar Optional[str] cover_image?: The app's default rich presence invite cover image - :ivar Optional[AppFlags] flags?: The application's public flags + :ivar Optional[Team] team: A list of team members, if this app belongs to a team. + :ivar Optional[Snowflake] guild_id: Guild ID linked, if this app is a game sold on Discord + :ivar Optional[int] primary_sku_id: Game SKU ID, if this app is a game sold on Discord + :ivar Optional[str] slug: URL slug that links to the store page, if this app is a game sold on Discord + :ivar Optional[str] cover_image: The app's default rich presence invite cover image + :ivar Optional[AppFlags] flags: The application's public flags """ id: Snowflake = field(converter=Snowflake) diff --git a/interactions/api/models/user.py b/interactions/api/models/user.py index 84e608ded..8642a9b91 100644 --- a/interactions/api/models/user.py +++ b/interactions/api/models/user.py @@ -15,19 +15,19 @@ class User(ClientSerializerMixin, IDMixin): :ivar Snowflake id: The User ID :ivar str username: The Username associated (not necessarily unique across the platform) :ivar str discriminator: The User's 4-digit discord-tag (i.e.: XXXX) - :ivar Optional[str] avatar?: The user's avatar hash, if any - :ivar Optional[bool] bot?: A status denoting if the user is a bot - :ivar Optional[bool] system?: A status denoting if the user is an Official Discord System user - :ivar Optional[bool] mfa_enabled?: A status denoting if the user has 2fa on their account - :ivar Optional[str] banner?: The user's banner hash, if any - :ivar Optional[str] banner_color?: The user's banner color as a hex, if any - :ivar Optional[int] accent_color?: The user's banner color as an integer represented of hex color codes - :ivar Optional[str] locale?: The user's chosen language option - :ivar Optional[bool] verified?: Whether the email associated with this account has been verified - :ivar Optional[str] email?: The user's email, if any - :ivar Optional[UserFlags] flags?: The user's flags - :ivar Optional[int] premium_type?: The type of Nitro subscription the user has - :ivar Optional[UserFlags] public_flags?: The user's public flags + :ivar Optional[str] avatar: The user's avatar hash, if any + :ivar Optional[bool] bot: A status denoting if the user is a bot + :ivar Optional[bool] system: A status denoting if the user is an Official Discord System user + :ivar Optional[bool] mfa_enabled: A status denoting if the user has 2fa on their account + :ivar Optional[str] banner: The user's banner hash, if any + :ivar Optional[str] banner_color: The user's banner color as a hex, if any + :ivar Optional[int] accent_color: The user's banner color as an integer represented of hex color codes + :ivar Optional[str] locale: The user's chosen language option + :ivar Optional[bool] verified: Whether the email associated with this account has been verified + :ivar Optional[str] email: The user's email, if any + :ivar Optional[UserFlags] flags: The user's flags + :ivar Optional[int] premium_type: The type of Nitro subscription the user has + :ivar Optional[UserFlags] public_flags: The user's public flags """ id: Snowflake = field(converter=Snowflake, repr=True) diff --git a/interactions/api/models/webhook.py b/interactions/api/models/webhook.py index 743da4b34..78bca6684 100644 --- a/interactions/api/models/webhook.py +++ b/interactions/api/models/webhook.py @@ -30,16 +30,16 @@ class Webhook(ClientSerializerMixin, IDMixin): :ivar Snowflake id: the id of the webhook :ivar WebhookType type: the type of the webhook - :ivar Snowflake guild_id?: the guild id this webhook is for, if any - :ivar Snowflake channel_id?: the channel id this webhook is for, if any - :ivar User user?: the user this webhook was created by (not returned when getting a webhook with its token) + :ivar Snowflake guild_id: the guild id this webhook is for, if any + :ivar Snowflake channel_id: the channel id this webhook is for, if any + :ivar User user: the user this webhook was created by (not returned when getting a webhook with its token) :ivar str name: the default name of the webhook :ivar str avatar: the default user avatar hash of the webhook :ivar str token: the secure token of the webhook (returned for Incoming Webhooks) :ivar Snowflake application_id: the bot/OAuth2 application that created this webhook - :ivar Guild source_guild?: the guild of the channel that this webhook is following (returned for Channel Follower Webhooks) - :ivar Channel source_channel?: the channel that this webhook is following (returned for Channel Follower Webhooks) - :ivar str url?: the url used for executing the webhook (returned by the webhooks OAuth2 flow) + :ivar Guild source_guild: the guild of the channel that this webhook is following (returned for Channel Follower Webhooks) + :ivar Channel source_channel: the channel that this webhook is following (returned for Channel Follower Webhooks) + :ivar str url: the url used for executing the webhook (returned by the webhooks OAuth2 flow) """ id: Snowflake = field(converter=Snowflake) @@ -209,7 +209,7 @@ async def execute( :type avatar_url: str :param tts: true if this is a TTS message :type tts: bool - :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] :param embeds: embedded ``rich`` content :type embeds: Union[Embed, List[Embed]] diff --git a/interactions/client/bot.py b/interactions/client/bot.py index a7f8819e1..ca4592b61 100644 --- a/interactions/client/bot.py +++ b/interactions/client/bot.py @@ -49,15 +49,15 @@ class Client: :param token: The token of the application for authentication and connection. :type token: str - :param intents?: Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to ``Intents.DEFAULT``. + :param intents: Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to ``Intents.DEFAULT``. :type intents: Optional[Intents] - :param shards?: Dictates and controls the shards that the application connects under. + :param shards: Dictates and controls the shards that the application connects under. :type shards: Optional[List[Tuple[int]]] - :param presence?: Sets an RPC-like presence on the application when connected to the Gateway. + :param presence: Sets an RPC-like presence on the application when connected to the Gateway. :type presence: Optional[ClientPresence] - :param default_scope?: Sets the default scope of all commands. + :param default_scope: Sets the default scope of all commands. :type default_scope: Optional[Union[int, Guild, List[int], List[Guild]]] - :param disable_sync?: Controls whether synchronization in the user-facing API should be automatic or not. + :param disable_sync: Controls whether synchronization in the user-facing API should be automatic or not. :type disable_sync: Optional[bool] :ivar AbstractEventLoop _loop: The asynchronous event loop of the client. @@ -960,25 +960,25 @@ async def sudo(ctx): .. note:: If ``default_member_permissions`` is not given, this will default to anyone that is able to use the command. - :param type?: The type of application command. Defaults to :meth:`interactions.enums.ApplicationCommandType.CHAT_INPUT` or ``1``. + :param type: The type of application command. Defaults to :meth:`interactions.enums.ApplicationCommandType.CHAT_INPUT` or ``1``. :type type: Optional[Union[str, int, ApplicationCommandType]] :param name: The name of the application command. This *is* required but kept optional to follow kwarg rules. :type name: Optional[str] - :param description?: The description of the application command. This should be left blank if you are not using ``CHAT_INPUT``. + :param description: The description of the application command. This should be left blank if you are not using ``CHAT_INPUT``. :type description: Optional[str] - :param scope?: The "scope"/applicable guilds the application command applies to. + :param scope: The "scope"/applicable guilds the application command applies to. :type scope: Optional[Union[int, Guild, List[int], List[Guild]]] - :param options?: The "arguments"/options of an application command. This should be left blank if you are not using ``CHAT_INPUT``. + :param options: The "arguments"/options of an application command. This should be left blank if you are not using ``CHAT_INPUT``. :type options: Optional[Union[Dict[str, Any], List[Dict[str, Any]], Option, List[Option]]] - :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. + :param description_localizations: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. :type description_localizations: Optional[Dict[Union[str, Locale], str]] - :param default_member_permissions?: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` + :param default_member_permissions: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` :type default_member_permissions: Optional[Union[int, Permissions]] - :param dm_permission?: The application permissions if executed in a Direct Message. Defaults to ``True``. + :param dm_permission: The application permissions if executed in a Direct Message. Defaults to ``True``. :type dm_permission: Optional[bool] - :param default_scope?: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. + :param default_scope: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. :type default_scope: bool :return: A callable response. :rtype: Callable[[Callable[..., Coroutine]], Command] @@ -1031,17 +1031,17 @@ async def context_menu_name(ctx): :param name: The name of the application command. :type name: Optional[str] - :param scope?: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. + :param scope: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. :type scope: Optional[Union[int, Guild, List[int], List[Guild]]] - :param default_permission?: The default permission of accessibility for the application command. Defaults to ``True``. + :param default_permission: The default permission of accessibility for the application command. Defaults to ``True``. :type default_permission: Optional[bool] - :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param default_member_permissions?: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` + :param default_member_permissions: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` :type default_member_permissions: Optional[Union[int, Permissions]] - :param dm_permission?: The application permissions if executed in a Direct Message. Defaults to ``True``. + :param dm_permission: The application permissions if executed in a Direct Message. Defaults to ``True``. :type dm_permission: Optional[bool] - :param default_scope?: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. + :param default_scope: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. :type default_scope: bool :return: A callable response. :rtype: Callable[[Callable[..., Coroutine]], Command] @@ -1088,17 +1088,17 @@ async def context_menu_name(ctx): :param name: The name of the application command. :type name: Optional[str] - :param scope?: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. + :param scope: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. :type scope: Optional[Union[int, Guild, List[int], List[Guild]]] - :param default_permission?: The default permission of accessibility for the application command. Defaults to ``True``. + :param default_permission: The default permission of accessibility for the application command. Defaults to ``True``. :type default_permission: Optional[bool] - :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param default_member_permissions?: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` + :param default_member_permissions: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` :type default_member_permissions: Optional[Union[int, Permissions]] - :param dm_permission?: The application permissions if executed in a Direct Message. Defaults to ``True``. + :param dm_permission: The application permissions if executed in a Direct Message. Defaults to ``True``. :type dm_permission: Optional[bool] - :param default_scope?: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. + :param default_scope: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. :type default_scope: bool :return: A callable response. :rtype: Callable[[Callable[..., Coroutine]], Command] @@ -1297,11 +1297,11 @@ def load( :param name: The name of the extension. :type name: str - :param package?: The package of the extension. + :param package: The package of the extension. :type package: Optional[str] - :param \*args?: Optional arguments to pass to the extension + :param \*args: Optional arguments to pass to the extension :type \**args: tuple - :param \**kwargs?: Optional keyword-only arguments to pass to the extension. + :param \**kwargs: Optional keyword-only arguments to pass to the extension. :type \**kwargs: dict :return: The loaded extension. :rtype: Optional[Extension] @@ -1336,9 +1336,9 @@ def remove( :param name: The name of the extension. :type name: str - :param remove_commands?: Whether to remove commands before reloading. Defaults to True. + :param remove_commands: Whether to remove commands before reloading. Defaults to True. :type remove_commands: bool - :param package?: The package of the extension. + :param package: The package of the extension. :type package: Optional[str] """ try: @@ -1392,13 +1392,13 @@ def reload( :param name: The name of the extension :type name: str - :param package?: The package of the extension + :param package: The package of the extension :type package: Optional[str] - :param remove_commands?: Whether to remove commands before reloading. Defaults to True + :param remove_commands: Whether to remove commands before reloading. Defaults to True :type remove_commands: bool - :param \*args?: Optional arguments to pass to the extension + :param \*args: Optional arguments to pass to the extension :type \**args: tuple - :param \**kwargs?: Optional keyword-only arguments to pass to the extension. + :param \**kwargs: Optional keyword-only arguments to pass to the extension. :type \**kwargs: dict :return: The reloaded extension. :rtype: Optional[Extension] @@ -1424,10 +1424,10 @@ async def modify( """ Modify the bot user account settings. - :param username?: The new username of the bot - :type username?: Optional[str] - :param avatar?: The new avatar of the bot - :type avatar?: Optional[Image] + :param username: The new username of the bot + :type username: Optional[str] + :param avatar: The new avatar of the bot + :type avatar: Optional[Image] :return: The modified User object :rtype: User """ diff --git a/interactions/client/context.py b/interactions/client/context.py index ab78a5396..79ae8eeb0 100644 --- a/interactions/client/context.py +++ b/interactions/client/context.py @@ -35,7 +35,7 @@ class _Context(ClientSerializerMixin): easily access information presented from any event in a "contextualized" sense. - :ivar Optional[Message] message?: The message data model. + :ivar Optional[Message] message: The message data model. :ivar Member author: The member data model. :ivar User user: The user data model. :ivar Optional[Channel] channel: The channel data model. @@ -119,19 +119,19 @@ async def send( This allows the invocation state described in the "context" to send an interaction response. - :param content?: The contents of the message as a string or string-converted value. + :param content: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param embeds?: An embed, or list of embeds for the message. + :param embeds: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions?: The message interactions/mention limits that the message can refer to. + :param allowed_mentions: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] - :param components?: A component, or list of components for the message. + :param components: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[Union[ActionRow, Button, SelectMenu]]]] - :param ephemeral?: Whether the response is hidden or not. + :param ephemeral: Whether the response is hidden or not. :type ephemeral: Optional[bool] :return: The sent message as an object. :rtype: Message @@ -315,16 +315,16 @@ class CommandContext(_Context): :ivar Snowflake id: The ID of the interaction. :ivar Snowflake application_id: The application ID of the interaction. :ivar InteractionType type: The type of interaction. - :ivar InteractionData data?: The application command data. + :ivar InteractionData data: The application command data. :ivar Optional[Union[Message, Member, User]] target: The target selected if this interaction is invoked as a context menu. :ivar str token: The token of the interaction response. - :ivar Snowflake guild_id?: The ID of the current guild. - :ivar Snowflake channel_id?: The ID of the current channel. + :ivar Snowflake guild_id: The ID of the current guild. + :ivar Snowflake channel_id: The ID of the current channel. :ivar bool responded: Whether an original response was made or not. :ivar bool deferred: Whether the response was deferred or not. - :ivar str locale?: The selected language of the user invoking the interaction. - :ivar str guild_locale?: The guild's preferred language, if invoked in a guild. - :ivar str app_permissions?: Bitwise set of permissions the bot has within the channel the interaction was sent from. + :ivar str locale: The selected language of the user invoking the interaction. + :ivar str guild_locale: The guild's preferred language, if invoked in a guild. + :ivar str app_permissions: Bitwise set of permissions the bot has within the channel the interaction was sent from. """ target: Optional[Union[Message, Member, User]] = field(default=None) @@ -410,7 +410,7 @@ async def defer(self, ephemeral: Optional[bool] = False) -> None: This "defers" an interaction response, allowing up to a 15-minute delay between invocation and responding. - :param ephemeral?: Whether the deferred state is hidden or not. + :param ephemeral: Whether the deferred state is hidden or not. :type ephemeral: Optional[bool] """ if not self.responded: @@ -630,9 +630,9 @@ async def defer( This "defers" a component response, allowing up to a 15-minute delay between invocation and responding. - :param ephemeral?: Whether the deferred state is hidden or not. + :param ephemeral: Whether the deferred state is hidden or not. :type ephemeral: Optional[bool] - :param edit_origin?: Whether you want to edit the original message or send a followup message + :param edit_origin: Whether you want to edit the original message or send a followup message :type edit_origin: Optional[bool] """ if not self.responded: diff --git a/interactions/client/models/command.py b/interactions/client/models/command.py index 601dbeb0f..92de550a4 100644 --- a/interactions/client/models/command.py +++ b/interactions/client/models/command.py @@ -46,7 +46,7 @@ class Choice(DictSerializerMixin): :ivar str name: The name of the choice. :ivar Union[str, int, float] value: The returned value of the choice. - :ivar Optional[Dict[Union[str, Locale], str]] name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :ivar Optional[Dict[Union[str, Locale], str]] name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. """ name: str = field() @@ -96,16 +96,16 @@ class Option(DictSerializerMixin): :ivar str name: The name of the option. :ivar str description: The description of the option. :ivar bool focused: Whether the option is currently being autocompleted or not. - :ivar Optional[bool] required?: Whether the option has to be filled out. - :ivar Optional[str] value?: The value that's currently typed out, if autocompleting. - :ivar Optional[List[Choice]] choices?: The list of choices to select from. - :ivar Optional[List[Option]] options?: The list of subcommand options included. - :ivar Optional[List[ChannelType]] channel_types?: Restrictive shown channel types, if given. - :ivar Optional[int] min_value?: The minimum value supported by the option. - :ivar Optional[int] max_value?: The maximum value supported by the option. - :ivar Optional[bool] autocomplete?: A status denoting whether this option is an autocomplete option. - :ivar Optional[Dict[Union[str, Locale], str]] name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. - :ivar Optional[Dict[Union[str, Locale], str]] description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. + :ivar Optional[bool] required: Whether the option has to be filled out. + :ivar Optional[str] value: The value that's currently typed out, if autocompleting. + :ivar Optional[List[Choice]] choices: The list of choices to select from. + :ivar Optional[List[Option]] options: The list of subcommand options included. + :ivar Optional[List[ChannelType]] channel_types: Restrictive shown channel types, if given. + :ivar Optional[int] min_value: The minimum value supported by the option. + :ivar Optional[int] max_value: The maximum value supported by the option. + :ivar Optional[bool] autocomplete: A status denoting whether this option is an autocomplete option. + :ivar Optional[Dict[Union[str, Locale], str]] name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :ivar Optional[Dict[Union[str, Locale], str]] description_localizations: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. :ivar Optional[str] converter: How the option value is passed to the function, if different than ``name`` """ @@ -181,12 +181,12 @@ class ApplicationCommand(DictSerializerMixin): :ivar Snowflake id: The ID of the application command. :ivar ApplicationCommandType type: The application command type. - :ivar Optional[Snowflake] application_id?: The general application ID of the command itself. - :ivar Optional[Snowflake] guild_id?: The guild ID of the application command. + :ivar Optional[Snowflake] application_id: The general application ID of the command itself. + :ivar Optional[Snowflake] guild_id: The guild ID of the application command. :ivar str name: The name of the application command. :ivar str description: The description of the application command. - :ivar Optional[List[Option]] options?: The "options"/arguments of the application command. - :ivar Optional[bool] default_permission?: The default permission accessibility state of the application command. + :ivar Optional[List[Option]] options: The "options"/arguments of the application command. + :ivar Optional[bool] default_permission: The default permission accessibility state of the application command. :ivar int version: The Application Command version autoincrement identifier. :ivar str default_member_permissions: The default member permission state of the application command. :ivar boolean dm_permission: The application permissions if executed in a Direct Message. @@ -232,7 +232,7 @@ async def my_command(ctx, opt: str): :type option_type: OptionType :param name: The name of the option. :type name: str - :param description?: The description of the option. Defaults to ``"No description set"``. + :param description: The description of the option. Defaults to ``"No description set"``. :type description: str :param \**kwargs: The keyword arguments of the option, same as :class:`Option`. :type \**kwargs: dict @@ -523,17 +523,17 @@ async def subcommand_group(ctx): If you want to create both subcommands and subcommands with groups, first create the subcommands without groups, then create the subcommands with groups. - :param group?: The name of the group the subcommand belongs to. Defaults to the most recently used group. + :param group: The name of the group the subcommand belongs to. Defaults to the most recently used group. :type group: Optional[str] - :param name?: The name of the subcommand. Defaults to the name of the coroutine. + :param name: The name of the subcommand. Defaults to the name of the coroutine. :type name: Optional[str] - :param description?: The description of the subcommand. Defaults to the docstring of the coroutine. + :param description: The description of the subcommand. Defaults to the docstring of the coroutine. :type description: Optional[str] - :param options?: The options of the subcommand. + :param options: The options of the subcommand. :type options: Optional[List[Option]] - :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. + :param description_localizations: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. :type description_localizations: Optional[Dict[Union[str, Locale], str]] :return: The :class:`interactions.client.models.command.Command` object. :rtype: Command @@ -630,13 +630,13 @@ async def subcommand_group(ctx): If you want to create both subcommands and subcommands with groups, first create the subcommands without groups, then create the subcommands with groups. - :param name?: The name of the group. Defaults to the name of the coroutine. + :param name: The name of the group. Defaults to the name of the coroutine. :type name: Optional[str] - :param description?: The description of the group. Defaults to the docstring of the coroutine. + :param description: The description of the group. Defaults to the docstring of the coroutine. :type description: Optional[str] - :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. + :param description_localizations: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. :type description_localizations: Optional[Dict[Union[str, Locale], str]] :return: The :class:`interactions.client.models.command.Command` object. :rtype: Command @@ -739,7 +739,7 @@ def autocomplete( """ Decorator for creating an autocomplete for the command. - :param name?: The name of the option to autocomplete. Defaults to the name of the coroutine. + :param name: The name of the option to autocomplete. Defaults to the name of the coroutine. :type name: Optional[str] :return: The coroutine :rtype: Callable[..., Coroutine] diff --git a/interactions/client/models/component.py b/interactions/client/models/component.py index c95ab9bb8..7e78196c2 100644 --- a/interactions/client/models/component.py +++ b/interactions/client/models/component.py @@ -50,9 +50,9 @@ class SelectOption(ComponentMixin): ) :ivar str label: The label of the select option. :ivar str value: The returned value of the select option. - :ivar Optional[str] description?: The description of the select option. - :ivar Optional[Emoji] emoji?: The emoji used alongside the label of the select option. - :ivar Optional[bool] default?: Whether the select option is the default for the select menu. + :ivar Optional[str] description: The description of the select option. + :ivar Optional[Emoji] emoji: The emoji used alongside the label of the select option. + :ivar Optional[bool] default: Whether the select option is the default for the select menu. """ label: str = field() @@ -79,10 +79,10 @@ class SelectMenu(ComponentMixin): :ivar ComponentType type: The type of select menu. Always defaults to ``3``. :ivar str custom_id: The customized "ID" of the select menu. :ivar List[SelectOption] options: The list of select options in the select menu. - :ivar Optional[str] placeholder?: The placeholder of the select menu. - :ivar Optional[int] min_values?: The minimum "options"/values to choose from the component. - :ivar Optional[int] max_values?: The maximum "options"/values to choose from the component. - :ivar Optional[bool] disabled?: Whether the select menu is unable to be used. + :ivar Optional[str] placeholder: The placeholder of the select menu. + :ivar Optional[int] min_values: The minimum "options"/values to choose from the component. + :ivar Optional[int] max_values: The maximum "options"/values to choose from the component. + :ivar Optional[bool] disabled: Whether the select menu is unable to be used. """ type: ComponentType = field(converter=ComponentType, default=ComponentType.SELECT) @@ -111,10 +111,10 @@ class Button(ComponentMixin): :ivar ComponentType type: The type of button. Always defaults to ``2``. :ivar ButtonStyle style: The style of the button. :ivar str label: The label of the button. - :ivar Optional[Emoji] emoji?: The emoji used alongside the label of the button. - :ivar Optional[str] custom_id?: The customized "ID" of the button. - :ivar Optional[str] url?: The URL route/path of the button. - :ivar Optional[bool] disabled?: Whether the button is unable to be used. + :ivar Optional[Emoji] emoji: The emoji used alongside the label of the button. + :ivar Optional[str] custom_id: The customized "ID" of the button. + :ivar Optional[str] url: The URL route/path of the button. + :ivar Optional[bool] disabled: Whether the button is unable to be used. """ type: ComponentType = field(converter=ComponentType, default=ComponentType.BUTTON) @@ -144,21 +144,21 @@ class Component(ComponentMixin): back information involving a component. Do not use this object for sending. :ivar ComponentType type: The type of component. - :ivar Optional[str] custom_id?: The customized "ID" of the component. - :ivar Optional[bool] disabled?: Whether the component is unable to be used. - :ivar Optional[ButtonStyle] style?: The style of the component. - :ivar Optional[str] label?: The label of the component. - :ivar Optional[Emoji] emoji?: The emoji used alongside the label of the component. - :ivar Optional[str] url?: The URl route/path of the component. - :ivar Optional[List[SelectMenu]] options?: The "choices"/options of the component. - :ivar Optional[str] placeholder?: The placeholder text/value of the component. - :ivar Optional[int] min_values?: The minimum "options"/values to choose from the component. - :ivar Optional[int] max_values?: The maximum "options"/values to choose from the component. - :ivar Optional[List[Component]] components?: A list of components nested in the component. - :ivar Optional[int] min_length?: The minimum input length to choose from the component. - :ivar Optional[int] max_length?: The maximum input length to choose from the component. - :ivar Optional[bool] required?: Whether this component is required to be filled. - :ivar Optional[str] value?: The pre-filled value of the component. + :ivar Optional[str] custom_id: The customized "ID" of the component. + :ivar Optional[bool] disabled: Whether the component is unable to be used. + :ivar Optional[ButtonStyle] style: The style of the component. + :ivar Optional[str] label: The label of the component. + :ivar Optional[Emoji] emoji: The emoji used alongside the label of the component. + :ivar Optional[str] url: The URl route/path of the component. + :ivar Optional[List[SelectMenu]] options: The "choices"/options of the component. + :ivar Optional[str] placeholder: The placeholder text/value of the component. + :ivar Optional[int] min_values: The minimum "options"/values to choose from the component. + :ivar Optional[int] max_values: The maximum "options"/values to choose from the component. + :ivar Optional[List[Component]] components: A list of components nested in the component. + :ivar Optional[int] min_length: The minimum input length to choose from the component. + :ivar Optional[int] max_length: The maximum input length to choose from the component. + :ivar Optional[bool] required: Whether this component is required to be filled. + :ivar Optional[str] value: The pre-filled value of the component. """ type: ComponentType = field(converter=ComponentType) @@ -205,10 +205,10 @@ class TextInput(ComponentMixin): :ivar str custom_id: The custom Id of the input. :ivar str label: The label of the input. :ivar Optional[str] value: The pre-filled value of the input. - :ivar Optional[bool] required?: Whether the input is required or not. - :ivar Optional[str] placeholder?: The placeholder of the input. - :ivar Optional[int] min_length?: The minimum length of the input. - :ivar Optional[int] max_length?: The maximum length of the input. + :ivar Optional[bool] required: Whether the input is required or not. + :ivar Optional[str] placeholder: The placeholder of the input. + :ivar Optional[int] min_length: The minimum length of the input. + :ivar Optional[int] max_length: The maximum length of the input. """ type: ComponentType = field(converter=ComponentType, default=ComponentType.INPUT_TEXT) @@ -274,7 +274,7 @@ class ActionRow(ComponentMixin): interactions.ActionRow(components=[...]) :ivar int type: The type of component. Always defaults to ``1``. - :ivar Optional[List[Component]] components?: A list of components the ActionRow has, if any. + :ivar Optional[List[Component]] components: A list of components the ActionRow has, if any. """ type: ComponentType = field(ComponentType, default=ComponentType.ACTION_ROW) diff --git a/interactions/client/models/misc.py b/interactions/client/models/misc.py index 40c223c0e..a495706c5 100644 --- a/interactions/client/models/misc.py +++ b/interactions/client/models/misc.py @@ -49,12 +49,12 @@ class InteractionData(DictSerializerMixin): :ivar str id: The ID of the interaction data. :ivar str name: The name of the interaction. :ivar ApplicationCommandType type: The type of command from the interaction. - :ivar Optional[InteractionResolvedData] resolved?: The resolved version of the data. - :ivar Optional[Option, List[Option]] options?: The options of the interaction. - :ivar Optional[str] custom_id?: The custom ID of the interaction. - :ivar Optional[ComponentType] component_type?: The type of component from the interaction. - :ivar Optional[List[str]] values?: The values of the selected options in the interaction. - :ivar Optional[str] target_id?: The targeted ID of the interaction. + :ivar Optional[InteractionResolvedData] resolved: The resolved version of the data. + :ivar Optional[Option, List[Option]] options: The options of the interaction. + :ivar Optional[str] custom_id: The custom ID of the interaction. + :ivar Optional[ComponentType] component_type: The type of component from the interaction. + :ivar Optional[List[str]] values: The values of the selected options in the interaction. + :ivar Optional[str] target_id: The targeted ID of the interaction. """ id: Snowflake = field(converter=Snowflake, default=None) @@ -79,14 +79,14 @@ class Interaction(DictSerializerMixin): :ivar str id: The ID of the interaction. :ivar str application_id: The application's ID of the interaction. :ivar InteractionType type: The type of interaction. - :ivar Optional[InteractionData] data?: The data of the interaction. - :ivar Optional[str] guild_id?: The guild ID of the interaction. - :ivar Optional[str] channel_id?: The channel ID of the interaction. - :ivar Optional[Member] member?: The member who invoked the interaction. - :ivar Optional[User] user?: The user who invoked the interaction. + :ivar Optional[InteractionData] data: The data of the interaction. + :ivar Optional[str] guild_id: The guild ID of the interaction. + :ivar Optional[str] channel_id: The channel ID of the interaction. + :ivar Optional[Member] member: The member who invoked the interaction. + :ivar Optional[User] user: The user who invoked the interaction. :ivar str token: The token of the interaction. :ivar version: The version of the interaction as an autoincrement identifier. - :ivar Optional[Message] message?: The message of the interaction. + :ivar Optional[Message] message: The message of the interaction. """ id: Snowflake = field(converter=Snowflake) diff --git a/interactions/client/models/utils.py b/interactions/client/models/utils.py index 3422865a2..6cde888b0 100644 --- a/interactions/client/models/utils.py +++ b/interactions/client/models/utils.py @@ -31,11 +31,11 @@ async def command(ctx): await asyncio.sleep(5) await ctx.send("I'm awake now!") - :param delay?: The amount of time in seconds to wait before defering the command. Defaults to ``2`` seconds. + :param delay: The amount of time in seconds to wait before defering the command. Defaults to ``2`` seconds. :type delay: Union[float, int] - :param ephemeral?: Whether the command is deferred ephemerally. Defaults to ``False``. + :param ephemeral: Whether the command is deferred ephemerally. Defaults to ``False``. :type ephemeral: bool - :param edit_origin?: Whether the command is deferred on origin. Defaults to ``False``. + :param edit_origin: Whether the command is deferred on origin. Defaults to ``False``. :type edit_origin: bool :return: The inner function, for decorating. :rtype: @@ -101,7 +101,7 @@ async def command(ctx): :param \*components: The components to spread. :type \*components: Union[ActionRow, Button, SelectMenu] - :param max_in_row?: The maximum number of components in a single row. Defaults to ``5``. + :param max_in_row: The maximum number of components in a single row. Defaults to ``5``. :type max_in_row: int """ if not components or len(components) > 25: diff --git a/interactions/ext/base.py b/interactions/ext/base.py index 1a98b32af..b38235c40 100644 --- a/interactions/ext/base.py +++ b/interactions/ext/base.py @@ -55,13 +55,13 @@ def __init__( :type link: str :param description: The description of the library, e.g. the purpose. :type description: str - :param long_description?: The full description of the library, e.g. README. Defaults to ``None``. + :param long_description: The full description of the library, e.g. README. Defaults to ``None``. :type long_description: Optional[str] - :param packages?: The package(s) of the library. Defaults to ``None``. + :param packages: The package(s) of the library. Defaults to ``None``. :type packages: Optional[List[str]] - :param requirements?: The required modules needed for library function. Defaults to ``None``. + :param requirements: The required modules needed for library function. Defaults to ``None``. :type requirements: Optional[List[str]] - :param kwargs?: Any other keyword arguments. Defaults to ``None``. + :param kwargs: Any other keyword arguments. Defaults to ``None``. :type kwargs: Optional[dict] """ self.version: Version = version diff --git a/interactions/ext/version.py b/interactions/ext/version.py index 2269bb57b..6407f3e39 100644 --- a/interactions/ext/version.py +++ b/interactions/ext/version.py @@ -43,11 +43,11 @@ def __init__( """ :param name: The name of the author. :type name: str - :param shared?: The author's relationship as the main or co-author. Defaults to ``False``. + :param shared: The author's relationship as the main or co-author. Defaults to ``False``. :type shared: Optional[bool] - :param active?: The author's state of activity. Defaults to ``True``. + :param active: The author's state of activity. Defaults to ``True``. :type active: Optional[bool] - :param email?: The author's email address or point of contact. Defaults to ``None``. + :param email: The author's email address or point of contact. Defaults to ``None``. :type email: Optional[str] """ self.name = name @@ -93,13 +93,13 @@ class Version: def __init__(self, **kwargs) -> None: """ - :param major?: The major version. If not specified, ``version`` will be read from. + :param major: The major version. If not specified, ``version`` will be read from. :type major: Optional[Union[str, int]] - :param minor?: The minor version. If not specified, ``version`` will be read from. + :param minor: The minor version. If not specified, ``version`` will be read from. :type minor: Optional[Union[str, int]] - :param patch?: The patch version. If not specified, ``version`` will be read from. + :param patch: The patch version. If not specified, ``version`` will be read from. :type patch: Optional[Union[str, int]] - :param version?: The overall version. Must be used if ``major``, ``minor`` or ``patch`` are not. + :param version: The overall version. Must be used if ``major``, ``minor`` or ``patch`` are not. :type version: Optional[str] """ self._major = int(kwargs.get("major") or kwargs.get("version", "0.0.0").split(".")[0]) From 0e8ae2e33a76b0dc766761115d897e33f70cbf5d Mon Sep 17 00:00:00 2001 From: Toricane Date: Sat, 16 Jul 2022 22:45:10 -0700 Subject: [PATCH 2/5] refactor: see if adding ? to both param and type works --- interactions/client/bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interactions/client/bot.py b/interactions/client/bot.py index ca4592b61..8bfa7c09b 100644 --- a/interactions/client/bot.py +++ b/interactions/client/bot.py @@ -49,10 +49,10 @@ class Client: :param token: The token of the application for authentication and connection. :type token: str - :param intents: Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to ``Intents.DEFAULT``. - :type intents: Optional[Intents] - :param shards: Dictates and controls the shards that the application connects under. - :type shards: Optional[List[Tuple[int]]] + :param intents?: Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to ``Intents.DEFAULT``. + :type intents?: Optional[Intents] + :param shards?: Dictates and controls the shards that the application connects under. + :type shards?: Optional[List[Tuple[int]]] :param presence: Sets an RPC-like presence on the application when connected to the Gateway. :type presence: Optional[ClientPresence] :param default_scope: Sets the default scope of all commands. From faa4859ab754cf6e70f83ec63baa6b4f96adad48 Mon Sep 17 00:00:00 2001 From: Toricane Date: Sun, 17 Jul 2022 13:04:23 -0700 Subject: [PATCH 3/5] Revert "refactor: see if adding ? to both param and type works" This reverts commit 0e8ae2e33a76b0dc766761115d897e33f70cbf5d. --- interactions/client/bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interactions/client/bot.py b/interactions/client/bot.py index 8bfa7c09b..ca4592b61 100644 --- a/interactions/client/bot.py +++ b/interactions/client/bot.py @@ -49,10 +49,10 @@ class Client: :param token: The token of the application for authentication and connection. :type token: str - :param intents?: Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to ``Intents.DEFAULT``. - :type intents?: Optional[Intents] - :param shards?: Dictates and controls the shards that the application connects under. - :type shards?: Optional[List[Tuple[int]]] + :param intents: Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to ``Intents.DEFAULT``. + :type intents: Optional[Intents] + :param shards: Dictates and controls the shards that the application connects under. + :type shards: Optional[List[Tuple[int]]] :param presence: Sets an RPC-like presence on the application when connected to the Gateway. :type presence: Optional[ClientPresence] :param default_scope: Sets the default scope of all commands. From a52bfe4f23b79474d841fec77c2287354d7538e1 Mon Sep 17 00:00:00 2001 From: Toricane Date: Sun, 17 Jul 2022 13:04:38 -0700 Subject: [PATCH 4/5] Revert "docs: remove question marks in docstrings" This reverts commit d466a5730ef13d60774c87193e076176db3b7b31. --- interactions/api/dispatch.py | 2 +- interactions/api/gateway/client.py | 12 +- interactions/api/http/request.py | 2 +- interactions/api/http/route.py | 2 +- interactions/api/models/channel.py | 146 +++++----- interactions/api/models/guild.py | 352 ++++++++++++------------ interactions/api/models/gw.py | 92 +++---- interactions/api/models/member.py | 46 ++-- interactions/api/models/message.py | 236 ++++++++-------- interactions/api/models/misc.py | 6 +- interactions/api/models/presence.py | 48 ++-- interactions/api/models/role.py | 30 +- interactions/api/models/team.py | 24 +- interactions/api/models/user.py | 26 +- interactions/api/models/webhook.py | 14 +- interactions/client/bot.py | 78 +++--- interactions/client/context.py | 34 +-- interactions/client/models/command.py | 54 ++-- interactions/client/models/component.py | 62 ++--- interactions/client/models/misc.py | 24 +- interactions/client/models/utils.py | 8 +- interactions/ext/base.py | 8 +- interactions/ext/version.py | 14 +- 23 files changed, 660 insertions(+), 660 deletions(-) diff --git a/interactions/api/dispatch.py b/interactions/api/dispatch.py index c7ce8a5dd..4183e1ed6 100644 --- a/interactions/api/dispatch.py +++ b/interactions/api/dispatch.py @@ -57,7 +57,7 @@ def register(self, coro: Callable[..., Coroutine], name: Optional[str] = None) - :param coro: The coroutine to register as an event. :type coro: Callable[..., Coroutine] - :param name: The name to associate the coroutine with. Defaults to None. + :param name?: The name to associate the coroutine with. Defaults to None. :type name: Optional[str] """ _name: str = coro.__name__ if name is None else name diff --git a/interactions/api/gateway/client.py b/interactions/api/gateway/client.py index 21999d963..fe6926dee 100644 --- a/interactions/api/gateway/client.py +++ b/interactions/api/gateway/client.py @@ -101,9 +101,9 @@ def __init__( :type token: str :param intents: The Gateway intents of the application for event dispatch. :type intents: Intents - :param session_id: The ID of the session if trying to reconnect. Defaults to ``None``. + :param session_id?: The ID of the session if trying to reconnect. Defaults to ``None``. :type session_id: Optional[str] - :param sequence: The identifier sequence if trying to reconnect. Defaults to ``None``. + :param sequence?: The identifier sequence if trying to reconnect. Defaults to ``None``. :type sequence: Optional[int] """ try: @@ -167,7 +167,7 @@ async def _establish_connection( """ Establishes a client connection with the Gateway. - :param shard: The shards to establish a connection with. Defaults to ``None``. + :param shard?: The shards to establish a connection with. Defaults to ``None``. :type shard: Optional[List[Tuple[int]]] :param presence: The presence to carry with. Defaults to ``None``. :type presence: Optional[ClientPresence] @@ -209,7 +209,7 @@ async def _handle_connection( :param stream: The packet stream to handle. :type stream: Dict[str, Any] - :param shard: The shards to establish a connection with. Defaults to ``None``. + :param shard?: The shards to establish a connection with. Defaults to ``None``. :type shard: Optional[List[Tuple[int]]] :param presence: The presence to carry with. Defaults to ``None``. :type presence: Optional[ClientPresence] @@ -660,9 +660,9 @@ async def __identify( """ Sends an ``IDENTIFY`` packet to the gateway. - :param shard: The shard ID to identify under. + :param shard?: The shard ID to identify under. :type shard: Optional[List[Tuple[int]]] - :param presence: The presence to change the bot to on identify. + :param presence?: The presence to change the bot to on identify. :type presence: Optional[ClientPresence] """ self.__shard = shard diff --git a/interactions/api/http/request.py b/interactions/api/http/request.py index 086fed0b7..96d9d6779 100644 --- a/interactions/api/http/request.py +++ b/interactions/api/http/request.py @@ -92,7 +92,7 @@ async def request(self, route: Route, **kwargs) -> Optional[Any]: :param route: The HTTP route to request. :type route: Route - :param \**kwargs: Optional keyword-only arguments to pass as information in the request. + :param \**kwargs?: Optional keyword-only arguments to pass as information in the request. :type \**kwargs: dict :return: The contents of the request if any. :rtype: Optional[Any] diff --git a/interactions/api/http/route.py b/interactions/api/http/route.py index 1f3d45567..cf20a2455 100644 --- a/interactions/api/http/route.py +++ b/interactions/api/http/route.py @@ -27,7 +27,7 @@ def __init__(self, method: str, path: str, **kwargs) -> None: :type method: str :param path: The path of the HTTP/URL. :type path: str - :param \**kwargs: Optional keyword-only arguments to pass as information in the route. + :param \**kwargs?: Optional keyword-only arguments to pass as information in the route. :type \**kwargs: dict """ self.method = method diff --git a/interactions/api/models/channel.py b/interactions/api/models/channel.py index 0f59e8706..cef609b04 100644 --- a/interactions/api/models/channel.py +++ b/interactions/api/models/channel.py @@ -59,7 +59,7 @@ class ThreadMetadata(DictSerializerMixin): :ivar int auto_archive_duration: The auto-archive time. :ivar datetime archive_timestamp: The timestamp that the thread will be/has been closed at. :ivar bool locked: The current message state of the thread. - :ivar Optional[bool] invitable: The ability to invite users to the thread. + :ivar Optional[bool] invitable?: The ability to invite users to the thread. """ archived: bool = field() @@ -78,7 +78,7 @@ class ThreadMember(ClientSerializerMixin): ``id`` only shows if there are active intents involved with the member in the thread. - :ivar Optional[Snowflake] id: The "ID" or intents of the member. + :ivar Optional[Snowflake] id?: The "ID" or intents of the member. :ivar Snowflake user_id: The user ID of the member. :ivar datetime join_timestamp: The timestamp of when the member joined the thread. :ivar int flags: The bitshift flags for the member in the thread. @@ -104,30 +104,30 @@ class Channel(ClientSerializerMixin, IDMixin): :ivar Snowflake id: The (snowflake) ID of the channel. :ivar ChannelType type: The type of channel. - :ivar Optional[Snowflake] guild_id: The ID of the guild if it is not a DM channel. - :ivar Optional[int] position: The position of the channel. + :ivar Optional[Snowflake] guild_id?: The ID of the guild if it is not a DM channel. + :ivar Optional[int] position?: The position of the channel. :ivar List[Overwrite] permission_overwrites: The non-synced permissions of the channel. :ivar str name: The name of the channel. - :ivar Optional[str] topic: The description of the channel. - :ivar Optional[bool] nsfw: Whether the channel is NSFW. + :ivar Optional[str] topic?: The description of the channel. + :ivar Optional[bool] nsfw?: Whether the channel is NSFW. :ivar Snowflake last_message_id: The ID of the last message sent. - :ivar Optional[int] bitrate: The audio bitrate of the channel. - :ivar Optional[int] user_limit: The maximum amount of users allowed in the channel. - :ivar Optional[int] rate_limit_per_user: The concurrent ratelimit for users in the channel. - :ivar Optional[List[User]] recipients: The recipients of the channel. - :ivar Optional[str] icon: The icon of the channel. - :ivar Optional[Snowflake] owner_id: The owner of the channel. - :ivar Optional[Snowflake] application_id: The application of the channel. - :ivar Optional[Snowflake] parent_id: The ID of the "parent"/main channel. - :ivar Optional[datetime] last_pin_timestamp: The timestamp of the last pinned message in the channel. - :ivar Optional[str] rtc_region: The region of the WebRTC connection for the channel. - :ivar Optional[int] video_quality_mode: The set quality mode for video streaming in the channel. + :ivar Optional[int] bitrate?: The audio bitrate of the channel. + :ivar Optional[int] user_limit?: The maximum amount of users allowed in the channel. + :ivar Optional[int] rate_limit_per_user?: The concurrent ratelimit for users in the channel. + :ivar Optional[List[User]] recipients?: The recipients of the channel. + :ivar Optional[str] icon?: The icon of the channel. + :ivar Optional[Snowflake] owner_id?: The owner of the channel. + :ivar Optional[Snowflake] application_id?: The application of the channel. + :ivar Optional[Snowflake] parent_id?: The ID of the "parent"/main channel. + :ivar Optional[datetime] last_pin_timestamp?: The timestamp of the last pinned message in the channel. + :ivar Optional[str] rtc_region?: The region of the WebRTC connection for the channel. + :ivar Optional[int] video_quality_mode?: The set quality mode for video streaming in the channel. :ivar int message_count: The amount of messages in the channel. - :ivar Optional[int] member_count: The amount of members in the channel. - :ivar Optional[ThreadMetadata] thread_metadata: The thread metadata of the channel. - :ivar Optional[ThreadMember] member: The member of the thread in the channel. - :ivar Optional[int] default_auto_archive_duration: The set auto-archive time for all threads to naturally follow in the channel. - :ivar Optional[str] permissions: The permissions of the channel. + :ivar Optional[int] member_count?: The amount of members in the channel. + :ivar Optional[ThreadMetadata] thread_metadata?: The thread metadata of the channel. + :ivar Optional[ThreadMember] member?: The member of the thread in the channel. + :ivar Optional[int] default_auto_archive_duration?: The set auto-archive time for all threads to naturally follow in the channel. + :ivar Optional[str] permissions?: The permissions of the channel. """ __slots__ = ( @@ -209,21 +209,21 @@ async def send( """ Sends a message in the channel. - :param content: The contents of the message as a string or string-converted value. + :param content?: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param tts: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param files: A file or list of files to be attached to the message. + :param files?: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param embeds: An embed, or list of embeds for the message. + :param embeds?: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions: The message interactions/mention limits that the message can refer to. + :param allowed_mentions?: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] - :param stickers: A list of stickers to send with your message. You can send up to 3 stickers per message. + :param stickers?: A list of stickers to send with your message. You can send up to 3 stickers per message. :type stickers: Optional[List[Sticker]] - :param components: A component, or list of components for the message. + :param components?: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[Actionrow], List[Button], List[SelectMenu]]] :return: The sent message as an object. :rtype: Message @@ -313,31 +313,31 @@ async def modify( .. note:: The fields `archived`, `auto_archive_duration` and `locked` require the provided channel to be a thread. - :param name: The name of the channel, defaults to the current value of the channel + :param name?: The name of the channel, defaults to the current value of the channel :type name: str - :param topic: The topic of that channel, defaults to the current value of the channel + :param topic?: The topic of that channel, defaults to the current value of the channel :type topic: Optional[str] - :param bitrate: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel + :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel :type bitrate: Optional[int] - :param user_limit: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel + :param user_limit?: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel :type user_limit: Optional[int] - :param rate_limit_per_use: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel + :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel :type rate_limit_per_user: Optional[int] - :param position: Sorting position of the channel, defaults to the current value of the channel + :param position?: Sorting position of the channel, defaults to the current value of the channel :type position: Optional[int] - :param parent_id: The id of the parent category for a channel, defaults to the current value of the channel + :param parent_id?: The id of the parent category for a channel, defaults to the current value of the channel :type parent_id: Optional[int] - :param nsfw: Whether the channel is nsfw or not, defaults to the current value of the channel + :param nsfw?: Whether the channel is nsfw or not, defaults to the current value of the channel :type nsfw: Optional[bool] - :param permission_overwrites: The permission overwrites, if any + :param permission_overwrites?: The permission overwrites, if any :type permission_overwrites: Optional[List[Overwrite]] - :param archived: Whether the thread is archived + :param archived?: Whether the thread is archived :type archived: Optional[bool] - :param auto_archive_duration: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 + :param auto_archive_duration?: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param locked: Whether the thread is locked + :param locked?: Whether the thread is locked :type locked: Optional[bool] - :param reason: The reason for the edit + :param reason?: The reason for the edit :type reason: Optional[str] :return: The modified channel as new object :rtype: Channel @@ -413,7 +413,7 @@ async def set_name( :param name: The new name of the channel :type name: str - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -432,7 +432,7 @@ async def set_topic( :param topic: The new topic of the channel :type topic: str - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -451,7 +451,7 @@ async def set_bitrate( :param bitrate: The new bitrate of the channel :type bitrate: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -473,7 +473,7 @@ async def set_user_limit( :param user_limit: The new user limit of the channel :type user_limit: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -497,7 +497,7 @@ async def set_rate_limit_per_user( :param rate_limit_per_user: The new rate_limit_per_user of the channel (0-21600) :type rate_limit_per_user: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -516,7 +516,7 @@ async def set_position( :param position: The new position of the channel :type position: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -535,7 +535,7 @@ async def set_parent_id( :param parent_id: The new parent_id of the channel :type parent_id: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -554,7 +554,7 @@ async def set_nsfw( :param nsfw: The new nsfw-flag of the channel :type nsfw: bool - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -573,7 +573,7 @@ async def archive( :param archived: Whether the Thread is archived, defaults to True :type archived: bool - :param reason: The reason of the archiving + :param reason?: The reason of the archiving :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -592,7 +592,7 @@ async def set_auto_archive_duration( :param auto_archive_duration: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 :type auto_archive_duration: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -611,7 +611,7 @@ async def lock( :param locked: Whether the Thread is locked, defaults to True :type locked: bool - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] :return: The edited channel :rtype: Channel @@ -777,13 +777,13 @@ def check_pinned(message): :param amount: The amount of messages to delete :type amount: int - :param check: The function used to check if a message should be deleted. The message is only deleted if the check returns `True` + :param check?: The function used to check if a message should be deleted. The message is only deleted if the check returns `True` :type check: Callable[[Message], bool] - :param before: An id of a message to purge only messages before that message + :param before?: An id of a message to purge only messages before that message :type before: Optional[int] - :param bulk: Whether to bulk delete the messages (you cannot delete messages older than 14 days, default) or to delete every message seperately + :param bulk?: Whether to bulk delete the messages (you cannot delete messages older than 14 days, default) or to delete every message seperately :param bulk: Optional[bool] - :param reason: The reason of the deletes + :param reason?: The reason of the deletes :type reason: Optional[str] :return: A list of the deleted messages :rtype: List[Message] @@ -972,16 +972,16 @@ async def create_thread( :param name: The name of the thread :type name: str - :param auto_archive_duration: duration in minutes to automatically archive the thread after recent activity, + :param auto_archive_duration?: duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param type: The type of thread, defaults to public. ignored if creating thread from a message + :param type?: The type of thread, defaults to public. ignored if creating thread from a message :type type: Optional[ChannelType] - :param invitable: Boolean to display if the Thread is open to join or private. + :param invitable?: Boolean to display if the Thread is open to join or private. :type invitable: Optional[bool] - :param message_id: An optional message to create a thread from. + :param message_id?: An optional message to create a thread from. :type message_id: Optional[Union[int, Snowflake, "Message"]] - :param reason: An optional reason for the audit log + :param reason?: An optional reason for the audit log :type reason: Optional[str] :return: The created thread :rtype: Channel @@ -1035,21 +1035,21 @@ async def create_invite( """ Creates an invite for the channel - :param max_age: Duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days). Default 86400 (24h) + :param max_age?: Duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days). Default 86400 (24h) :type max_age: Optional[int] - :param max_uses: Max number of uses or 0 for unlimited. between 0 and 100. Default 0 + :param max_uses?: Max number of uses or 0 for unlimited. between 0 and 100. Default 0 :type max_uses: Optional[int] - :param temporary: Whether this invite only grants temporary membership. Default False + :param temporary?: Whether this invite only grants temporary membership. Default False :type temporary: Optional[bool] - :param unique: If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). Default False + :param unique?: If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). Default False :type unique: Optional[bool] - :param target_type: The type of target for this voice channel invite + :param target_type?: The type of target for this voice channel invite :type target_type: Optional["InviteTargetType"] - :param target_user_id: The id of the user whose stream to display for this invite, required if target_type is STREAM, the user must be streaming in the channel + :param target_user_id?: The id of the user whose stream to display for this invite, required if target_type is STREAM, the user must be streaming in the channel :type target_user_id: Optional[int] - :param target_application_id: The id of the embedded application to open for this invite, required if target_type is EMBEDDED_APPLICATION, the application must have the EMBEDDED flag + :param target_application_id?: The id of the embedded application to open for this invite, required if target_type is EMBEDDED_APPLICATION, the application must have the EMBEDDED flag :type target_application_id: Optional[int] - :param reason: The reason for the creation of the invite + :param reason?: The reason for the creation of the invite :type reason: Optional[str] """ @@ -1105,8 +1105,8 @@ async def get_history(self, limit: int = 100) -> Optional[List["Message"]]: """ Gets messages from the channel's history. - :param limit: The amount of messages to get. Default 100 - :type limit: int + :param limit?: The amount of messages to get. Default 100 + :type limit?: int :return: A list of messages :rtype: List[Message] """ diff --git a/interactions/api/models/guild.py b/interactions/api/models/guild.py index 4a2c22dcd..20964d430 100644 --- a/interactions/api/models/guild.py +++ b/interactions/api/models/guild.py @@ -138,8 +138,8 @@ class WelcomeChannels(DictSerializerMixin): :ivar Snowflake channel_id: The ID of the welcome channel. :ivar str description: The description of the welcome channel. - :ivar Optional[Snowflake] emoji_id: The ID of the emoji of the welcome channel. - :ivar Optional[str] emoji_name: The name of the emoji of the welcome channel. + :ivar Optional[Snowflake] emoji_id?: The ID of the emoji of the welcome channel. + :ivar Optional[str] emoji_name?: The name of the emoji of the welcome channel. """ channel_id: int = field() @@ -158,7 +158,7 @@ class WelcomeScreen(DictSerializerMixin): We assume it's for the welcome screen topic. - :ivar Optional[str] description: The description of the welcome screen. + :ivar Optional[str] description?: The description of the welcome screen. :ivar List[WelcomeChannels] welcome_channels: A list of welcome channels of the welcome screen. """ @@ -220,18 +220,18 @@ class Guild(ClientSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the guild. :ivar str name: The name of the guild. - :ivar Optional[str] icon: The icon of the guild. - :ivar Optional[str] icon_hash: The hashed version of the icon of the guild. - :ivar Optional[str] splash: The invite splash banner of the guild. - :ivar Optional[str] discovery_splash: The discovery splash banner of the guild. - :ivar Optional[bool] owner: Whether the guild is owned. + :ivar Optional[str] icon?: The icon of the guild. + :ivar Optional[str] icon_hash?: The hashed version of the icon of the guild. + :ivar Optional[str] splash?: The invite splash banner of the guild. + :ivar Optional[str] discovery_splash?: The discovery splash banner of the guild. + :ivar Optional[bool] owner?: Whether the guild is owned. :ivar Snowflake owner_id: The ID of the owner of the guild. - :ivar Optional[str] permissions: The permissions of the guild. - :ivar Optional[str] region: The geographical region of the guild. - :ivar Optional[Snowflake] afk_channel_id: The AFK voice channel of the guild. + :ivar Optional[str] permissions?: The permissions of the guild. + :ivar Optional[str] region?: The geographical region of the guild. + :ivar Optional[Snowflake] afk_channel_id?: The AFK voice channel of the guild. :ivar int afk_timeout: The timeout of the AFK voice channel of the guild. - :ivar Optional[bool] widget_enabled: Whether widgets are enabled in the guild. - :ivar Optional[Snowflake] widget_channel_id: The channel ID of the widget in the guild. + :ivar Optional[bool] widget_enabled?: Whether widgets are enabled in the guild. + :ivar Optional[Snowflake] widget_channel_id?: The channel ID of the widget in the guild. :ivar int verification_level: The level of user verification of the guild. :ivar int default_message_notifications: The default message notifications setting of the guild. :ivar int explicit_content_filter: The explicit content filter setting level of the guild. @@ -239,34 +239,34 @@ class Guild(ClientSerializerMixin, IDMixin): :ivar List[Emoji] emojis: The list of emojis from the guild. :ivar List[GuildFeature] features: The list of features of the guild. :ivar int mfa_level: The MFA level of the guild. - :ivar Optional[Snowflake] application_id: The application ID of the guild. - :ivar Optional[Snowflake] system_channel_id: The channel ID of the system of the guild. - :ivar Optional[Snowflake] rules_channel_id: The channel ID of Discord's defined "rules" channel of the guild. - :ivar Optional[datetime] joined_at: The timestamp the member joined the guild. - :ivar Optional[bool] large: Whether the guild is considered "large." - :ivar Optional[bool] unavailable: Whether the guild is unavailable to access. - :ivar Optional[int] member_count: The amount of members in the guild. - :ivar Optional[List[Member]] members: The members in the guild. - :ivar Optional[List[Channel]] channels: The channels in the guild. - :ivar Optional[List[Thread]] threads: All known threads in the guild. - :ivar Optional[List[PresenceUpdate]] presences: The list of presences in the guild. - :ivar Optional[int] max_presences: The maximum amount of presences allowed in the guild. - :ivar Optional[int] max_members: The maximum amount of members allowed in the guild. - :ivar Optional[str] vanity_url_code: The vanity URL of the guild. - :ivar Optional[str] description: The description of the guild. - :ivar Optional[str] banner: The banner of the guild. + :ivar Optional[Snowflake] application_id?: The application ID of the guild. + :ivar Optional[Snowflake] system_channel_id?: The channel ID of the system of the guild. + :ivar Optional[Snowflake] rules_channel_id?: The channel ID of Discord's defined "rules" channel of the guild. + :ivar Optional[datetime] joined_at?: The timestamp the member joined the guild. + :ivar Optional[bool] large?: Whether the guild is considered "large." + :ivar Optional[bool] unavailable?: Whether the guild is unavailable to access. + :ivar Optional[int] member_count?: The amount of members in the guild. + :ivar Optional[List[Member]] members?: The members in the guild. + :ivar Optional[List[Channel]] channels?: The channels in the guild. + :ivar Optional[List[Thread]] threads?: All known threads in the guild. + :ivar Optional[List[PresenceUpdate]] presences?: The list of presences in the guild. + :ivar Optional[int] max_presences?: The maximum amount of presences allowed in the guild. + :ivar Optional[int] max_members?: The maximum amount of members allowed in the guild. + :ivar Optional[str] vanity_url_code?: The vanity URL of the guild. + :ivar Optional[str] description?: The description of the guild. + :ivar Optional[str] banner?: The banner of the guild. :ivar int premium_tier: The server boost level of the guild. - :ivar Optional[int] premium_subscription_count: The amount of server boosters in the guild. + :ivar Optional[int] premium_subscription_count?: The amount of server boosters in the guild. :ivar str preferred_locale: The "preferred" local region of the guild. - :ivar Optional[Snowflake] public_updates_channel_id: The channel ID for community updates of the guild. - :ivar Optional[int] max_video_channel_users: The maximum amount of video streaming members in a channel allowed in a guild. - :ivar Optional[int] approximate_member_count: The approximate amount of members in the guild. - :ivar Optional[int] approximate_presence_count: The approximate amount of presences in the guild. - :ivar Optional[WelcomeScreen] welcome_screen: The welcome screen of the guild. + :ivar Optional[Snowflake] public_updates_channel_id?: The channel ID for community updates of the guild. + :ivar Optional[int] max_video_channel_users?: The maximum amount of video streaming members in a channel allowed in a guild. + :ivar Optional[int] approximate_member_count?: The approximate amount of members in the guild. + :ivar Optional[int] approximate_presence_count?: The approximate amount of presences in the guild. + :ivar Optional[WelcomeScreen] welcome_screen?: The welcome screen of the guild. :ivar int nsfw_level: The NSFW safety filter level of the guild. - :ivar Optional[List[StageInstance]] stage_instances: The stage instance of the guild. - :ivar Optional[List[Sticker]] stickers: The list of stickers from the guild. - :ivar Optional[bool] premium_progress_bar_enabled: Whether the guild has the boost progress bar enabled. + :ivar Optional[List[StageInstance]] stage_instances?: The stage instance of the guild. + :ivar Optional[List[Sticker]] stickers?: The list of stickers from the guild. + :ivar Optional[bool] premium_progress_bar_enabled?: Whether the guild has the boost progress bar enabled. """ id: Snowflake = field(converter=Snowflake) @@ -373,9 +373,9 @@ async def ban( :param member_id: The id of the member to ban :type member_id: Union[int, Member, Snowflake] - :param reason: The reason of the ban + :param reason?: The reason of the ban :type reason: Optional[str] - :param delete_message_days: Number of days to delete messages, from 0 to 7. Defaults to 0 + :param delete_message_days?: Number of days to delete messages, from 0 to 7. Defaults to 0 :type delete_message_days: Optional[int] """ if not self._client: @@ -405,7 +405,7 @@ async def remove_ban( :param user_id: The id of the user to remove the ban from :type user_id: Union[int, Snowflake] - :param reason: The reason for the removal of the ban + :param reason?: The reason for the removal of the ban :type reason: Optional[str] """ if not self._client: @@ -426,7 +426,7 @@ async def kick( :param member_id: The id of the member to kick :type member_id: Union[int, Member, Snowflake] - :param reason: The reason for the kick + :param reason?: The reason for the kick :type reason: Optional[str] """ if not self._client: @@ -455,7 +455,7 @@ async def add_member_role( :type role Union[Role, int, Snowflake] :param member_id: The id of the member to add the roles to :type member_id: Union[Member, int, Snowflake] - :param reason: The reason why the roles are added + :param reason?: The reason why the roles are added :type reason: Optional[str] """ if not self._client: @@ -484,7 +484,7 @@ async def remove_member_role( :type role: Union[Role, int, Snowflake] :param member_id: The id of the member to remove the roles from :type member_id: Union[Member, int, Snowflake] - :param reason: The reason why the roles are removed + :param reason?: The reason why the roles are removed :type reason: Optional[str] """ if not self._client: @@ -516,19 +516,19 @@ async def create_role( :param name: The name of the role :type name: str - :param color: RGB color value as integer, default ``0`` + :param color?: RGB color value as integer, default ``0`` :type color: Optional[int] - :param permissions: Bitwise value of the enabled/disabled permissions + :param permissions?: Bitwise value of the enabled/disabled permissions :type permissions: Optional[int] - :param hoist: Whether the role should be displayed separately in the sidebar, default ``False`` + :param hoist?: Whether the role should be displayed separately in the sidebar, default ``False`` :type hoist: Optional[bool] - :param icon: The role's icon image (if the guild has the ROLE_ICONS feature) + :param icon?: The role's icon image (if the guild has the ROLE_ICONS feature) :type icon: Optional[Image] - :param unicode_emoji: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature) + :param unicode_emoji?: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature) :type unicode_emoji: Optional[str] - :param mentionable: Whether the role should be mentionable, default ``False`` + :param mentionable?: Whether the role should be mentionable, default ``False`` :type mentionable: Optional[bool] - :param reason: The reason why the role is created, default ``None`` + :param reason?: The reason why the role is created, default ``None`` :type reason: Optional[str] :return: The created Role :rtype: Role @@ -619,7 +619,7 @@ async def delete_role( :param role_id: The id of the role to delete :type role_id: Union[int, Snowflake, Role] - :param reason: The reason of the deletion + :param reason?: The reason of the deletion :type reason: Optional[str] """ if not self._client: @@ -656,21 +656,21 @@ async def modify_role( :param role_id: The id of the role to edit :type role_id: Union[int, Snowflake, Role] - :param name: The name of the role, defaults to the current value of the role + :param name?: The name of the role, defaults to the current value of the role :type name: Optional[str] - :param color: RGB color value as integer, defaults to the current value of the role + :param color?: RGB color value as integer, defaults to the current value of the role :type color: Optional[int] - :param permissions: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role + :param permissions?: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role :type permissions: Optional[int] - :param hoist: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role + :param hoist?: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role :type hoist: Optional[bool] - :param icon: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role + :param icon?: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role :type icon: Optional[Image] - :param unicode_emoji: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role + :param unicode_emoji?: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role :type unicode_emoji: Optional[str] - :param mentionable: Whether the role should be mentionable, defaults to the current value of the role + :param mentionable?: Whether the role should be mentionable, defaults to the current value of the role :type mentionable: Optional[bool] - :param reason: The reason why the role is edited, default ``None`` + :param reason?: The reason why the role is edited, default ``None`` :type reason: Optional[str] :return: The modified role object :rtype: Role @@ -735,16 +735,16 @@ async def create_thread( :type name: str :param channel_id: The id of the channel to create the thread in :type channel_id: Union[int, Snowflake, Channel] - :param auto_archive_duration: duration in minutes to automatically archive the thread after recent activity, + :param auto_archive_duration?: duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param type: The type of thread, defaults to public. ignored if creating thread from a message + :param type?: The type of thread, defaults to public. ignored if creating thread from a message :type type: Optional[ChannelType] - :param invitable: Boolean to display if the Thread is open to join or private. + :param invitable?: Boolean to display if the Thread is open to join or private. :type invitable: Optional[bool] - :param message_id: An optional message to create a thread from. + :param message_id?: An optional message to create a thread from. :type message_id: Optional[Union[int, Snowflake, "Message"]] - :param reason: An optional reason for the audit log + :param reason?: An optional reason for the audit log :type reason: Optional[str] :return: The created thread :rtype: Channel @@ -801,21 +801,21 @@ async def create_channel( :type name: str :param type: The type of the channel :type type: ChannelType - :param topic: The topic of that channel + :param topic?: The topic of that channel :type topic: Optional[str] - :param bitrate: (voice channel only) The bitrate (in bits) of the voice channel + :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel :type bitrate: Optional[int] - :param user_limit: (voice channel only) Maximum amount of users in the channel + :param user_limit?: (voice channel only) Maximum amount of users in the channel :type user_limit: Optional[int] - :param rate_limit_per_use: Amount of seconds a user has to wait before sending another message (0-21600) + :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600) :type rate_limit_per_user: Optional[int] - :param position: Sorting position of the channel + :param position?: Sorting position of the channel :type position: Optional[int] - :param parent_id: The id of the parent category for a channel + :param parent_id?: The id of the parent category for a channel :type parent_id: Optional[Union[int, Channel, Snowflake]] - :param permission_overwrites: The permission overwrites, if any + :param permission_overwrites?: The permission overwrites, if any :type permission_overwrites: Optional[Overwrite] - :param nsfw: Whether the channel is nsfw or not, default ``False`` + :param nsfw?: Whether the channel is nsfw or not, default ``False`` :type nsfw: Optional[bool] :param reason: The reason for the creation :type reason: Optional[str] @@ -928,29 +928,29 @@ async def modify_channel( :param channel_id: The id of the channel to modify :type channel_id: Union[int, Snowflake, Channel] - :param name: The name of the channel, defaults to the current value of the channel + :param name?: The name of the channel, defaults to the current value of the channel :type name: str - :param topic: The topic of that channel, defaults to the current value of the channel + :param topic?: The topic of that channel, defaults to the current value of the channel :type topic: Optional[str] - :param bitrate: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel + :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel :type bitrate: Optional[int] - :param user_limit: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel + :param user_limit?: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel :type user_limit: Optional[int] - :param rate_limit_per_use: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel + :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel :type rate_limit_per_user: Optional[int] - :param position: Sorting position of the channel, defaults to the current value of the channel + :param position?: Sorting position of the channel, defaults to the current value of the channel :type position: Optional[int] - :param parent_id: The id of the parent category for a channel, defaults to the current value of the channel + :param parent_id?: The id of the parent category for a channel, defaults to the current value of the channel :type parent_id: Optional[int] - :param permission_overwrites: The permission overwrites, if any + :param permission_overwrites?: The permission overwrites, if any :type permission_overwrites: Optional[Overwrite] - :param nsfw: Whether the channel is nsfw or not, defaults to the current value of the channel + :param nsfw?: Whether the channel is nsfw or not, defaults to the current value of the channel :type nsfw: Optional[bool] - :param archived: Whether the thread is archived + :param archived?: Whether the thread is archived :type archived: Optional[bool] - :param auto_archive_duration: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 + :param auto_archive_duration?: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param locked: Whether the thread is locked + :param locked?: Whether the thread is locked :type locked: Optional[bool] :param reason: The reason for the edit :type reason: Optional[str] @@ -1049,19 +1049,19 @@ async def modify_member( :param member_id: The id of the member to modify :type member_id: Union[int, Snowflake, Member] - :param nick: The nickname of the member + :param nick?: The nickname of the member :type nick: Optional[str] - :param roles: A list of all role ids the member has + :param roles?: A list of all role ids the member has :type roles: Optional[List[int]] - :param mute: whether the user is muted in voice channels + :param mute?: whether the user is muted in voice channels :type mute: Optional[bool] - :param deaf: whether the user is deafened in voice channels + :param deaf?: whether the user is deafened in voice channels :type deaf: Optional[bool] - :param channel_id: id of channel to move user to (if they are connected to voice) + :param channel_id?: id of channel to move user to (if they are connected to voice) :type channel_id: Optional[int] - :param communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) + :param communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) :type communication_disabled_until: Optional[datetime.isoformat] - :param reason: The reason of the modifying + :param reason?: The reason of the modifying :type reason: Optional[str] :return: The modified member :rtype: Member @@ -1156,49 +1156,49 @@ async def modify( """ Modifies the current guild. - :param name: The new name of the guild + :param name?: The new name of the guild :type name: Optional[str] - :param verification_level: The verification level of the guild + :param verification_level?: The verification level of the guild :type verification_level: Optional[VerificationLevel] - :param default_message_notifications: The default message notification level for members + :param default_message_notifications?: The default message notification level for members :type default_message_notifications: Optional[DefaultMessageNotificationLevel] - :param explicit_content_filter: The explicit content filter level for media content + :param explicit_content_filter?: The explicit content filter level for media content :type explicit_content_filter: Optional[ExplicitContentFilterLevel] - :param afk_channel_id: The id for the afk voice channel + :param afk_channel_id?: The id for the afk voice channel :type afk_channel_id: Optional[int] - :param afk_timeout: Afk timeout in seconds + :param afk_timeout?: Afk timeout in seconds :type afk_timeout: Optional[int] - :param icon: 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature) + :param icon?: 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature) :type icon: Optional[Image] - :param owner_id: The id of the user to transfer the guild ownership to. You must be the owner to perform this + :param owner_id?: The id of the user to transfer the guild ownership to. You must be the owner to perform this :type owner_id: Optional[int] - :param splash: 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature) + :param splash?: 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature) :type splash: Optional[Image] - :param discovery_splash: 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature) + :param discovery_splash?: 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature) :type discovery_splash: Optional[Image] - :param banner: 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature; can be animated gif when the server has the ANIMATED_BANNER feature) + :param banner?: 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature; can be animated gif when the server has the ANIMATED_BANNER feature) :type banner: Optional[Image] - :param system_channel_id: The id of the channel where guild notices such as welcome messages and boost events are posted + :param system_channel_id?: The id of the channel where guild notices such as welcome messages and boost events are posted :type system_channel_id: Optional[int] - :param suppress_join_notifications: Whether to suppress member join notifications in the system channel or not + :param suppress_join_notifications?: Whether to suppress member join notifications in the system channel or not :type suppress_join_notifications: Optional[bool] - :param suppress_premium_subscriptions: Whether to suppress server boost notifications in the system channel or not + :param suppress_premium_subscriptions?: Whether to suppress server boost notifications in the system channel or not :type suppress_premium_subscriptions: Optional[bool] - :param suppress_guild_reminder_notifications: Whether to suppress server setup tips in the system channel or not + :param suppress_guild_reminder_notifications?: Whether to suppress server setup tips in the system channel or not :type suppress_guild_reminder_notifications: Optional[bool] - :param suppress_join_notification_replies: Whether to hide member join sticker reply buttons in the system channel or not + :param suppress_join_notification_replies?: Whether to hide member join sticker reply buttons in the system channel or not :type suppress_join_notification_replies: Optional[bool] - :param rules_channel_id: The id of the channel where guilds display rules and/or guidelines + :param rules_channel_id?: The id of the channel where guilds display rules and/or guidelines :type rules_channel_id: Optional[int] - :param public_updates_channel_id: The id of the channel where admins and moderators of community guilds receive notices from Discord + :param public_updates_channel_id?: The id of the channel where admins and moderators of community guilds receive notices from Discord :type public_updates_channel_id: Optional[int] - :param preferred_locale: The preferred locale of a community guild used in server discovery and notices from Discord; defaults to "en-US" + :param preferred_locale?: The preferred locale of a community guild used in server discovery and notices from Discord; defaults to "en-US" :type preferred_locale: Optional[str] - :param description: The description for the guild, if the guild is discoverable + :param description?: The description for the guild, if the guild is discoverable :type description: Optional[str] - :param premium_progress_bar_enabled: Whether the guild's boost progress bar is enabled + :param premium_progress_bar_enabled?: Whether the guild's boost progress bar is enabled :type premium_progress_bar_enabled: Optional[bool] - :param reason: The reason for the modifying + :param reason?: The reason for the modifying :type reason: Optional[str] :return: The modified guild :rtype: Guild @@ -1293,7 +1293,7 @@ async def set_name( :param name: The new name of the guild :type name: str - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(name=name, reason=reason) @@ -1309,7 +1309,7 @@ async def set_verification_level( :param verification_level: The new verification level of the guild :type verification_level: VerificationLevel - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(verification_level=verification_level, reason=reason) @@ -1325,7 +1325,7 @@ async def set_default_message_notifications( :param default_message_notifications: The new default message notification level of the guild :type default_message_notifications: DefaultMessageNotificationLevel - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify( @@ -1343,7 +1343,7 @@ async def set_explicit_content_filter( :param explicit_content_filter: The new explicit content filter level of the guild :type explicit_content_filter: ExplicitContentFilterLevel - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(explicit_content_filter=explicit_content_filter, reason=reason) @@ -1359,7 +1359,7 @@ async def set_afk_channel( :param afk_channel_id: The new name of the guild :type afk_channel_id: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(afk_channel_id=afk_channel_id, reason=reason) @@ -1375,7 +1375,7 @@ async def set_afk_timeout( :param afk_timeout: The new afk timeout of the guild :type afk_timeout: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(afk_timeout=afk_timeout, reason=reason) @@ -1391,7 +1391,7 @@ async def set_system_channel( :param system_channel_id: The new system channel id of the guild :type system_channel_id: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(system_channel_id=system_channel_id, reason=reason) @@ -1407,7 +1407,7 @@ async def set_rules_channel( :param rules_channel_id: The new rules channel id of the guild :type rules_channel_id: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(rules_channel_id=rules_channel_id, reason=reason) @@ -1423,7 +1423,7 @@ async def set_public_updates_channel( :param public_updates_channel_id: The new public updates channel id of the guild :type public_updates_channel_id: int - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(public_updates_channel_id=public_updates_channel_id, reason=reason) @@ -1439,7 +1439,7 @@ async def set_preferred_locale( :param preferred_locale: The new preferredlocale of the guild :type preferred_locale: str - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(preferred_locale=preferred_locale, reason=reason) @@ -1455,7 +1455,7 @@ async def set_description( :param description: The new description of the guild :type description: str - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(description=description, reason=reason) @@ -1471,7 +1471,7 @@ async def set_premium_progress_bar_enabled( :param premium_progress_bar_enabled: Whether the bar is enabled or not :type premium_progress_bar_enabled: bool - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify( @@ -1489,7 +1489,7 @@ async def set_icon( :param icon: The new icon of the guild :type icon: Image - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(icon=icon, reason=reason) @@ -1505,7 +1505,7 @@ async def set_splash( :param splash: The new splash of the guild :type splash: Image - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(splash=splash, reason=reason) @@ -1521,7 +1521,7 @@ async def set_discovery_splash( :param discovery_splash: The new discovery_splash of the guild :type discovery_splash: Image - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(discovery_splash=discovery_splash, reason=reason) @@ -1537,7 +1537,7 @@ async def set_banner( :param banner: The new banner of the guild :type banner: Image - :param reason: The reason of the edit + :param reason?: The reason of the edit :type reason: Optional[str] """ return await self.modify(banner=banner, reason=reason) @@ -1563,16 +1563,16 @@ async def create_scheduled_event( :type entity_type: EntityType :param scheduled_start_time: The time to schedule the scheduled event :type scheduled_start_time: datetime.isoformat - :param scheduled_end_time: The time when the scheduled event is scheduled to end + :param scheduled_end_time?: The time when the scheduled event is scheduled to end :type scheduled_end_time: Optional[datetime.isoformat] - :param entity_metadata: The entity metadata of the scheduled event + :param entity_metadata?: The entity metadata of the scheduled event :type entity_metadata: Optional[EventMetadata] - :param channel_id: The channel id of the scheduled event. + :param channel_id?: The channel id of the scheduled event. :type channel_id: Optional[int] - :param description: The description of the scheduled event + :param description?: The description of the scheduled event :type description: Optional[str] - :param image: The cover image of the scheduled event - :type image: Optional[Image] + :param image?: The cover image of the scheduled event + :type image?: Optional[Image] :return: The created event :rtype: ScheduledEvents """ @@ -1638,18 +1638,18 @@ async def modify_scheduled_event( :type entity_type: Optional[EntityType] :param scheduled_start_time: The time to schedule the scheduled event :type scheduled_start_time: Optional[datetime.isoformat] - :param scheduled_end_time: The time when the scheduled event is scheduled to end + :param scheduled_end_time?: The time when the scheduled event is scheduled to end :type scheduled_end_time: Optional[datetime.isoformat] - :param entity_metadata: The entity metadata of the scheduled event + :param entity_metadata?: The entity metadata of the scheduled event :type entity_metadata: Optional[EventMetadata] - :param channel_id: The channel id of the scheduled event. + :param channel_id?: The channel id of the scheduled event. :type channel_id: Optional[int] - :param description: The description of the scheduled event + :param description?: The description of the scheduled event :type description: Optional[str] - :param status: The status of the scheduled event + :param status?: The status of the scheduled event :type status: Optional[EventStatus] - :param image: The cover image of the scheduled event - :type image: Optional[Image] + :param image?: The cover image of the scheduled event + :type image?: Optional[Image] :return: The modified event :rtype: ScheduledEvents """ @@ -1795,7 +1795,7 @@ async def modify_role_position( :type role_id: Union[Role, int] :param position: The new position of the role :type position: int - :param reason: The reason for the modifying + :param reason?: The reason for the modifying :type reason: Optional[str] :return: List of guild roles with updated hierarchy :rtype: List[Role] @@ -1846,12 +1846,12 @@ async def get_bans( """ Gets a list of banned users. - :param limit: Number of users to return. Defaults to 1000. - :type limit: Optional[int] - :param before: Consider only users before the given User ID snowflake. - :type before: Optional[int] - :param after: Consider only users after the given User ID snowflake. - :type after: Optional[int] + :param limit?: Number of users to return. Defaults to 1000. + :type limit?: Optional[int] + :param before?: Consider only users before the given User ID snowflake. + :type before?: Optional[int] + :param after?: Consider only users after the given User ID snowflake. + :type after?: Optional[int] :return: List of banned users with reasons :rtype: List[Dict[str, User]] """ @@ -1952,12 +1952,12 @@ async def create_emoji( :param image: The image of the emoji. :type image: Image - :param name: The name of the emoji. If not specified, the filename will be used - :type name: Optional[str] - :param roles: Roles allowed to use this emoji - :type roles: Optional[Union[List[Role], List[int]]] - :param reason: The reason of the creation - :type reason: Optional[str] + :param name?: The name of the emoji. If not specified, the filename will be used + :type name?: Optional[str] + :param roles?: Roles allowed to use this emoji + :type roles?: Optional[Union[List[Role], List[int]]] + :param reason?: The reason of the creation + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -1994,8 +1994,8 @@ async def delete_emoji( :param emoji: The emoji or the id of the emoji to delete :type emoji: Union[Emoji, int] - :param reason: The reason of the deletion - :type reason: Optional[str] + :param reason?: The reason of the deletion + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -2020,9 +2020,9 @@ async def get_list_of_members( """ Lists the members of a guild. - :param limit: How many members to get from the API. Max is 1000. + :param limit?: How many members to get from the API. Max is 1000. :type limit: Optional[int] - :param after: Get only Members after this member. + :param after?: Get only Members after this member. :type after: Optional[Union[Member, int]] :return: A list of members :rtype: List[Member] @@ -2050,7 +2050,7 @@ async def search_members(self, query: str, limit: Optional[int] = 1) -> List[Mem :param query: The string to search for :type query: str - :param limit: The number of members to return. + :param limit?: The number of members to return. :type limit: Optional[int] :return: A list of matching members :rtype: List[Member] @@ -2333,14 +2333,14 @@ class GuildPreview(DictSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the guild. :ivar str name: The name of the guild. - :ivar Optional[str] icon: The icon of the guild. - :ivar Optional[str] splash: The invite splash banner of the guild. - :ivar Optional[str] discovery_splash: The discovery splash banner of the guild. + :ivar Optional[str] icon?: The icon of the guild. + :ivar Optional[str] splash?: The invite splash banner of the guild. + :ivar Optional[str] discovery_splash?: The discovery splash banner of the guild. :ivar List[Emoji] emojis: The list of emojis from the guild. :ivar List[GuildFeatures] features: The list of features of the guild. :ivar int approximate_member_count: The approximate amount of members in the guild. :ivar int approximate_presence_count: The approximate amount of presences in the guild. - :ivar Optional[str] description: The description of the guild. + :ivar Optional[str] description?: The description of the guild. """ id: Snowflake = field(converter=Snowflake) @@ -2401,7 +2401,7 @@ class GuildTemplate(DictSerializerMixin): :ivar str code: The code of the guild template. :ivar str name: The name of the guild template. - :ivar Optional[str] description: The description of the guild template, if given. + :ivar Optional[str] description?: The description of the guild template, if given. :ivar int usage_count: The amount of uses on the template. :ivar Snowflake creator_id: User ID of the creator of this template. :ivar User creator: The User object of the creator of this template. @@ -2409,7 +2409,7 @@ class GuildTemplate(DictSerializerMixin): :ivar datetime update_at: The time when this template was updated. :ivar Snowflake source_guild_id: The Guild ID that the template sourced from. :ivar Guild serialized_source_guild: A partial Guild object from the sourced template. - :ivar Optional[bool] is_dirty: A status that denotes if the changes are unsynced. + :ivar Optional[bool] is_dirty?: A status that denotes if the changes are unsynced. """ code: str = field() @@ -2430,7 +2430,7 @@ class EventMetadata(DictSerializerMixin): """ A class object representing the metadata of an event entity. - :ivar Optional[str] location: The location of the event, if any. + :ivar Optional[str] location?: The location of the event, if any. """ location: Optional[str] = field(default=None) @@ -2447,18 +2447,18 @@ class ScheduledEvents(DictSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the scheduled event. :ivar Snowflake guild_id: The ID of the guild that this scheduled event belongs to. - :ivar Optional[Snowflake] channel_id: The channel ID in which the scheduled event belongs to, if any. - :ivar Optional[Snowflake] creator_id: The ID of the user that created the scheduled event. + :ivar Optional[Snowflake] channel_id?: The channel ID in which the scheduled event belongs to, if any. + :ivar Optional[Snowflake] creator_id?: The ID of the user that created the scheduled event. :ivar str name: The name of the scheduled event. :ivar str description: The description of the scheduled event. - :ivar datetime scheduled_start_time: The scheduled event start time. - :ivar Optional[datetime] scheduled_end_time: The scheduled event end time, if any. + :ivar datetime scheduled_start_time?: The scheduled event start time. + :ivar Optional[datetime] scheduled_end_time?: The scheduled event end time, if any. :ivar int privacy_level: The privacy level of the scheduled event. :ivar int entity_type: The type of the scheduled event. - :ivar Optional[Snowflake] entity_id: The ID of the entity associated with the scheduled event. - :ivar Optional[EventMetadata] entity_metadata: Additional metadata associated with the scheduled event. - :ivar Optional[User] creator: The user that created the scheduled event. - :ivar Optional[int] user_count: The number of users subscribed to the scheduled event. + :ivar Optional[Snowflake] entity_id?: The ID of the entity associated with the scheduled event. + :ivar Optional[EventMetadata] entity_metadata?: Additional metadata associated with the scheduled event. + :ivar Optional[User] creator?: The user that created the scheduled event. + :ivar Optional[int] user_count?: The number of users subscribed to the scheduled event. :ivar int status: The status of the scheduled event :ivar Optional[str] image: The hash containing the image of an event, if applicable. """ diff --git a/interactions/api/models/gw.py b/interactions/api/models/gw.py index 87c48ffb8..b11966690 100644 --- a/interactions/api/models/gw.py +++ b/interactions/api/models/gw.py @@ -237,15 +237,15 @@ class GuildMember(ClientSerializerMixin): A class object representing the gateway events ``GUILD_MEMBER_ADD``, ``GUILD_MEMBER_UPDATE`` and ``GUILD_MEMBER_REMOVE``. :ivar Snowflake guild_id: The guild ID of the event. - :ivar Optional[List[Role]] roles: The roles of the event. - :ivar Optional[User] user: The user of the event. - :ivar Optional[str] nick: The nickname of the user of the event. - :ivar Optional[str] avatar: The avatar URL of the user of the event. - :ivar Optional[datetime] joined_at: The time that the user of the event joined at. - :ivar Optional[datetime] premium_since: The time that the user of the event has since had "premium." - :ivar Optional[bool] deaf: Whether the member of the event is deafened or not. - :ivar Optional[bool] mute: Whether the member of the event is muted or not. - :ivar Optional[bool] pending: Whether the member of the event is still pending -- pass membership screening -- or not. + :ivar Optional[List[Role]] roles?: The roles of the event. + :ivar Optional[User] user?: The user of the event. + :ivar Optional[str] nick?: The nickname of the user of the event. + :ivar Optional[str] avatar?: The avatar URL of the user of the event. + :ivar Optional[datetime] joined_at?: The time that the user of the event joined at. + :ivar Optional[datetime] premium_since?: The time that the user of the event has since had "premium." + :ivar Optional[bool] deaf?: Whether the member of the event is deafened or not. + :ivar Optional[bool] mute?: Whether the member of the event is muted or not. + :ivar Optional[bool] pending?: Whether the member of the event is still pending -- pass membership screening -- or not. """ guild_id: Snowflake = field(converter=Snowflake) @@ -304,9 +304,9 @@ async def ban( """ Bans the member from a guild. - :param reason: The reason of the ban + :param reason?: The reason of the ban :type reason: Optional[str] - :param delete_message_days: Number of days to delete messages, from 0 to 7. Defaults to 0 + :param delete_message_days?: Number of days to delete messages, from 0 to 7. Defaults to 0 :type delete_message_days: Optional[int] """ await self._client.create_guild_ban( @@ -323,7 +323,7 @@ async def kick( """ Kicks the member from a guild. - :param reason: The reason for the kick + :param reason?: The reason for the kick :type reason: Optional[str] """ if not self._client: @@ -344,7 +344,7 @@ async def add_role( :param role: The role to add. Either ``Role`` object or role_id :type role: Union[Role, int] - :param reason: The reason why the roles are added + :param reason?: The reason why the roles are added :type reason: Optional[str] """ if not self._client: @@ -374,7 +374,7 @@ async def remove_role( :param role: The role to remove. Either ``Role`` object or role_id :type role: Union[Role, int] - :param reason: The reason why the roles are removed + :param reason?: The reason why the roles are removed :type reason: Optional[str] """ if not self._client: @@ -416,17 +416,17 @@ async def send( """ Sends a DM to the member. - :param content: The contents of the message as a string or string-converted value. + :param content?: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param components: A component, or list of components for the message. + :param components?: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[Actionrow], List[Button], List[SelectMenu]]] - :param tts: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param files: A file or list of files to be attached to the message. + :param files?: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param embeds: An embed, or list of embeds for the message. + :param embeds?: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions: The message interactions/mention limits that the message can refer to. + :param allowed_mentions?: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] :return: The sent message as an object. :rtype: Message @@ -488,19 +488,19 @@ async def modify( """ Modifies the member of a guild. - :param nick: The nickname of the member + :param nick?: The nickname of the member :type nick: Optional[str] - :param roles: A list of all role ids the member has + :param roles?: A list of all role ids the member has :type roles: Optional[List[int]] - :param mute: whether the user is muted in voice channels + :param mute?: whether the user is muted in voice channels :type mute: Optional[bool] - :param deaf: whether the user is deafened in voice channels + :param deaf?: whether the user is deafened in voice channels :type deaf: Optional[bool] - :param channel_id: id of channel to move user to (if they are connected to voice) + :param channel_id?: id of channel to move user to (if they are connected to voice) :type channel_id: Optional[int] - :param communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) + :param communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) :type communication_disabled_until: Optional[datetime.isoformat] - :param reason: The reason of the modifying + :param reason?: The reason of the modifying :type reason: Optional[str] :return: The modified member object :rtype: Member @@ -585,7 +585,7 @@ class GuildRole(ClientSerializerMixin): :ivar Snowflake guild_id: The guild ID of the event. :ivar Optional[Role] role: The role of the event. - :ivar Optional[Snowflake] role_id: The role ID of the event. + :ivar Optional[Snowflake] role_id?: The role ID of the event. """ guild_id: Snowflake = field(converter=Snowflake) @@ -618,18 +618,18 @@ class GuildScheduledEvent(ClientSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the scheduled event. :ivar Snowflake guild_id: The ID of the guild that this scheduled event belongs to. - :ivar Optional[Snowflake] channel_id: The channel ID in which the scheduled event belongs to, if any. - :ivar Optional[Snowflake] creator_id: The ID of the user that created the scheduled event. + :ivar Optional[Snowflake] channel_id?: The channel ID in which the scheduled event belongs to, if any. + :ivar Optional[Snowflake] creator_id?: The ID of the user that created the scheduled event. :ivar str name: The name of the scheduled event. :ivar str description: The description of the scheduled event. - :ivar datetime scheduled_start_time: The scheduled event start time. - :ivar Optional[datetime] scheduled_end_time: The scheduled event end time, if any. + :ivar datetime scheduled_start_time?: The scheduled event start time. + :ivar Optional[datetime] scheduled_end_time?: The scheduled event end time, if any. :ivar int privacy_level: The privacy level of the scheduled event. :ivar int entity_type: The type of the scheduled event. - :ivar Optional[Snowflake] entity_id: The ID of the entity associated with the scheduled event. - :ivar Optional[EventMetadata] entity_metadata: Additional metadata associated with the scheduled event. - :ivar Optional[User] creator: The user that created the scheduled event. - :ivar Optional[int] user_count: The number of users subscribed to the scheduled event. + :ivar Optional[Snowflake] entity_id?: The ID of the entity associated with the scheduled event. + :ivar Optional[EventMetadata] entity_metadata?: Additional metadata associated with the scheduled event. + :ivar Optional[User] creator?: The user that created the scheduled event. + :ivar Optional[int] user_count?: The number of users subscribed to the scheduled event. :ivar int status: The status of the scheduled event :ivar Optional[str] image: The hash containing the image of an event, if applicable. """ @@ -760,12 +760,12 @@ class MessageReaction(DictSerializerMixin): """ A class object representing the gateway event ``MESSAGE_REACTION_ADD``. - :ivar Optional[Snowflake] user_id: The user ID of the event. + :ivar Optional[Snowflake] user_id?: The user ID of the event. :ivar Snowflake channel_id: The channel ID of the event. :ivar Snowflake message_id: The message ID of the event. - :ivar Optional[Snowflake] guild_id: The guild ID of the event. - :ivar Optional[Member] member: The member of the event. - :ivar Optional[Emoji] emoji: The emoji of the event. + :ivar Optional[Snowflake] guild_id?: The guild ID of the event. + :ivar Optional[Member] member?: The member of the event. + :ivar Optional[Emoji] emoji?: The emoji of the event. """ user_id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -784,11 +784,11 @@ class ReactionRemove(MessageReaction): This class inherits the already existing attributes of :class:`interactions.api.models.gw.Reaction`. The main missing attribute is ``member``. - :ivar Optional[Snowflake] user_id: The user ID of the event. + :ivar Optional[Snowflake] user_id?: The user ID of the event. :ivar Snowflake channel_id: The channel ID of the event. :ivar Snowflake message_id: The message ID of the event. - :ivar Optional[Snowflake] guild_id: The guild ID of the event. - :ivar Optional[Emoji] emoji: The emoji of the event. + :ivar Optional[Snowflake] guild_id?: The guild ID of the event. + :ivar Optional[Emoji] emoji?: The emoji of the event. """ # todo see if the missing member attribute affects anything @@ -800,7 +800,7 @@ class ThreadList(DictSerializerMixin): A class object representing the gateway event ``THREAD_LIST_SYNC``. :ivar Snowflake guild_id: The guild ID of the event. - :ivar Optional[List[Snowflake]] channel_ids: The channel IDs of the event. + :ivar Optional[List[Snowflake]] channel_ids?: The channel IDs of the event. :ivar List[Channel] threads: The threads of the event. :ivar List[ThreadMember] members: The members of the thread of the event. """ @@ -819,8 +819,8 @@ class ThreadMembers(DictSerializerMixin, IDMixin): :ivar Snowflake id: The ID of the event. :ivar Snowflake guild_id: The guild ID of the event. :ivar int member_count: The member count of the event. - :ivar Optional[List[ThreadMember]] added_members: The added members of the thread of the event. - :ivar Optional[List[Snowflake]] removed_member_ids: The removed IDs of members of the thread of the event. + :ivar Optional[List[ThreadMember]] added_members?: The added members of the thread of the event. + :ivar Optional[List[Snowflake]] removed_member_ids?: The removed IDs of members of the thread of the event. """ id: Snowflake = field(converter=Snowflake) diff --git a/interactions/api/models/member.py b/interactions/api/models/member.py index ef9901de9..d061f46dc 100644 --- a/interactions/api/models/member.py +++ b/interactions/api/models/member.py @@ -29,15 +29,15 @@ class Member(ClientSerializerMixin, IDMixin): :ivar User user: The user of the guild. :ivar str nick: The nickname of the member. - :ivar Optional[str] avatar: The hash containing the user's guild avatar, if applicable. + :ivar Optional[str] avatar?: The hash containing the user's guild avatar, if applicable. :ivar List[Role] roles: The list of roles of the member. :ivar datetime joined_at: The timestamp the member joined the guild at. :ivar datetime premium_since: The timestamp the member has been a server booster since. :ivar bool deaf: Whether the member is deafened. :ivar bool mute: Whether the member is muted. - :ivar Optional[bool] pending: Whether the member is pending to pass membership screening. - :ivar Optional[Permissions] permissions: Whether the member has permissions. - :ivar Optional[str] communication_disabled_until: How long until they're unmuted, if any. + :ivar Optional[bool] pending?: Whether the member is pending to pass membership screening. + :ivar Optional[Permissions] permissions?: Whether the member has permissions. + :ivar Optional[str] communication_disabled_until?: How long until they're unmuted, if any. """ user: Optional[User] = field(converter=User, default=None, add_client=True, repr=True) @@ -107,9 +107,9 @@ async def ban( :param guild_id: The id of the guild to ban the member from :type guild_id: Union[int, Snowflake, "Guild"] - :param reason: The reason of the ban + :param reason?: The reason of the ban :type reason: Optional[str] - :param delete_message_days: Number of days to delete messages, from 0 to 7. Defaults to 0 + :param delete_message_days?: Number of days to delete messages, from 0 to 7. Defaults to 0 :type delete_message_days: Optional[int] """ @@ -132,7 +132,7 @@ async def kick( :param guild_id: The id of the guild to kick the member from :type guild_id: Union[int, Snowflake, "Guild"] - :param reason: The reason for the kick + :param reason?: The reason for the kick :type reason: Optional[str] """ if not self._client: @@ -159,7 +159,7 @@ async def add_role( :type role: Union[Role, int, Snowflake] :param guild_id: The id of the guild to add the roles to the member :type guild_id: Union[int, Snowflake, "Guild"] - :param reason: The reason why the roles are added + :param reason?: The reason why the roles are added :type reason: Optional[str] """ if not self._client: @@ -188,7 +188,7 @@ async def remove_role( :type role: Union[Role, int] :param guild_id: The id of the guild to remove the roles of the member :type guild_id: Union[int, Snowflake, "Guild"] - :param reason: The reason why the roles are removed + :param reason?: The reason why the roles are removed :type reason: Optional[str] """ if not self._client: @@ -227,19 +227,19 @@ async def send( """ Sends a DM to the member. - :param content: The contents of the message as a string or string-converted value. + :param content?: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param components: A component, or list of components for the message. + :param components?: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] - :param tts: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param files: A file or list of files to be attached to the message. + :param files?: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param embeds: An embed, or list of embeds for the message. + :param embeds?: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions: The message interactions/mention limits that the message can refer to. + :param allowed_mentions?: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] :return: The sent message as an object. :rtype: Message @@ -304,19 +304,19 @@ async def modify( :param guild_id: The id of the guild to modify the member on :type guild_id: Union[int, Snowflake, "Guild"] - :param nick: The nickname of the member + :param nick?: The nickname of the member :type nick: Optional[str] - :param roles: A list of all role ids the member has + :param roles?: A list of all role ids the member has :type roles: Optional[List[int]] - :param mute: whether the user is muted in voice channels + :param mute?: whether the user is muted in voice channels :type mute: Optional[bool] - :param deaf: whether the user is deafened in voice channels + :param deaf?: whether the user is deafened in voice channels :type deaf: Optional[bool] - :param channel_id: id of channel to move user to (if they are connected to voice) + :param channel_id?: id of channel to move user to (if they are connected to voice) :type channel_id: Optional[Union[Channel, int, Snowflake]] - :param communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) + :param communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) :type communication_disabled_until: Optional[datetime.isoformat] - :param reason: The reason of the modifying + :param reason?: The reason of the modifying :type reason: Optional[str] :return: The modified member object :rtype: Member diff --git a/interactions/api/models/message.py b/interactions/api/models/message.py index ef71e40a0..4167c1bd0 100644 --- a/interactions/api/models/message.py +++ b/interactions/api/models/message.py @@ -87,7 +87,7 @@ class MessageActivity(DictSerializerMixin): i.e. : Phasmophobia and Call of Duty. :ivar str type: The message activity type. - :ivar Optional[Snowflake] party_id: The party ID of the activity. + :ivar Optional[Snowflake] party_id?: The party ID of the activity. """ type: int = field() @@ -103,10 +103,10 @@ class MessageReference(DictSerializerMixin): All of the attributes in this class are optionals because a message can potentially never be referenced. - :ivar Optional[Snowflake] message_id: The ID of the referenced message. - :ivar Optional[Snowflake] channel_id: The channel ID of the referenced message. - :ivar Optional[Snowflake] guild_id: The guild ID of the referenced message. - :ivar Optional[bool] fail_if_not_exists: Whether the message reference exists. + :ivar Optional[Snowflake] message_id?: The ID of the referenced message. + :ivar Optional[Snowflake] channel_id?: The channel ID of the referenced message. + :ivar Optional[Snowflake] guild_id?: The guild ID of the referenced message. + :ivar Optional[bool] fail_if_not_exists?: Whether the message reference exists. """ message_id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -130,13 +130,13 @@ class Attachment(ClientSerializerMixin, IDMixin): :ivar int id: The ID of the attachment. :ivar str filename: The name of the attachment file. - :ivar Optional[str] description: The description of the file. - :ivar Optional[str] content_type: The type of attachment file. + :ivar Optional[str] description?: The description of the file. + :ivar Optional[str] content_type?: The type of attachment file. :ivar int size: The size of the attachment file. :ivar str url: The CDN URL of the attachment file. :ivar str proxy_url: The proxied/cached CDN URL of the attachment file. - :ivar Optional[int] height: The height of the attachment file. - :ivar Optional[int] width: The width of the attachment file. + :ivar Optional[int] height?: The height of the attachment file. + :ivar Optional[int] width?: The width of the attachment file. :ivar Optional[bool] ephemeral: Whether the attachment is ephemeral. """ @@ -193,14 +193,14 @@ class Emoji(ClientSerializerMixin): """ A class objecting representing an emoji. - :ivar Optional[Snowflake] id: Emoji id - :ivar Optional[str] name: Emoji name. - :ivar Optional[List[Role]] roles: Roles allowed to use this emoji - :ivar Optional[User] user: User that created this emoji - :ivar Optional[bool] require_colons: Status denoting of this emoji must be wrapped in colons - :ivar Optional[bool] managed: Status denoting if this emoji is managed (by an integration) - :ivar Optional[bool] animated: Status denoting if this emoji is animated - :ivar Optional[bool] available: Status denoting if this emoji can be used. (Can be false via server boosting) + :ivar Optional[Snowflake] id?: Emoji id + :ivar Optional[str] name?: Emoji name. + :ivar Optional[List[Role]] roles?: Roles allowed to use this emoji + :ivar Optional[User] user?: User that created this emoji + :ivar Optional[bool] require_colons?: Status denoting of this emoji must be wrapped in colons + :ivar Optional[bool] managed?: Status denoting if this emoji is managed (by an integration) + :ivar Optional[bool] animated?: Status denoting if this emoji is animated + :ivar Optional[bool] available?: Status denoting if this emoji can be used. (Can be false via server boosting) """ id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -269,8 +269,8 @@ async def delete( :param guild_id: The guild id to delete the emoji from :type guild_id: Union[int, Snowflake, "Guild"] - :param reason: The reason of the deletion - :type reason: Optional[str] + :param reason?: The reason of the deletion + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -310,9 +310,9 @@ class EmbedImageStruct(DictSerializerMixin): ) :ivar str url: Source URL of the object. - :ivar Optional[str] proxy_url: Proxied url of the object. - :ivar Optional[int] height: Height of the object. - :ivar Optional[int] width: Width of the object. + :ivar Optional[str] proxy_url?: Proxied url of the object. + :ivar Optional[int] height?: Height of the object. + :ivar Optional[int] width?: Width of the object. """ url: str = field() @@ -337,8 +337,8 @@ class EmbedProvider(DictSerializerMixin): """ A class object representing the provider of an embed. - :ivar Optional[str] name: Name of provider - :ivar Optional[str] url: URL of provider + :ivar Optional[str] name?: Name of provider + :ivar Optional[str] url?: URL of provider """ name: Optional[str] = field(default=None) @@ -370,9 +370,9 @@ class EmbedAuthor(DictSerializerMixin): ) :ivar str name: Name of author - :ivar Optional[str] url: URL of author - :ivar Optional[str] icon_url: URL of author icon - :ivar Optional[str] proxy_icon_url: Proxied URL of author icon + :ivar Optional[str] url?: URL of author + :ivar Optional[str] icon_url?: URL of author icon + :ivar Optional[str] proxy_icon_url?: Proxied URL of author icon """ name: str = field() @@ -406,8 +406,8 @@ class EmbedFooter(DictSerializerMixin): ) :ivar str text: Footer text - :ivar Optional[str] icon_url: URL of footer icon - :ivar Optional[str] proxy_icon_url: Proxied URL of footer icon + :ivar Optional[str] icon_url?: URL of footer icon + :ivar Optional[str] proxy_icon_url?: Proxied URL of footer icon """ text: str = field() @@ -443,7 +443,7 @@ class EmbedField(DictSerializerMixin): :ivar str name: Name of the field. :ivar str value: Value of the field - :ivar Optional[bool] inline: A status denoting if the field should be displayed inline. + :ivar Optional[bool] inline?: A status denoting if the field should be displayed inline. """ name: str = field() @@ -482,19 +482,19 @@ class Embed(DictSerializerMixin): fields=[interaction.EmbedField(...)], ) - :ivar Optional[str] title: Title of embed - :ivar Optional[str] type: Embed type, relevant by CDN file connected. This is only important to rendering. - :ivar Optional[str] description: Embed description - :ivar Optional[str] url: URL of embed - :ivar Optional[datetime] timestamp: Timestamp of embed content - :ivar Optional[int] color: Color code of embed - :ivar Optional[EmbedFooter] footer: Footer information - :ivar Optional[EmbedImageStruct] image: Image information - :ivar Optional[EmbedImageStruct] thumbnail: Thumbnail information - :ivar Optional[EmbedImageStruct] video: Video information - :ivar Optional[EmbedProvider] provider: Provider information - :ivar Optional[EmbedAuthor] author: Author information - :ivar Optional[List[EmbedField]] fields: A list of fields denoting field information + :ivar Optional[str] title?: Title of embed + :ivar Optional[str] type?: Embed type, relevant by CDN file connected. This is only important to rendering. + :ivar Optional[str] description?: Embed description + :ivar Optional[str] url?: URL of embed + :ivar Optional[datetime] timestamp?: Timestamp of embed content + :ivar Optional[int] color?: Color code of embed + :ivar Optional[EmbedFooter] footer?: Footer information + :ivar Optional[EmbedImageStruct] image?: Image information + :ivar Optional[EmbedImageStruct] thumbnail?: Thumbnail information + :ivar Optional[EmbedImageStruct] video?: Video information + :ivar Optional[EmbedProvider] provider?: Provider information + :ivar Optional[EmbedAuthor] author?: Author information + :ivar Optional[List[EmbedField]] fields?: A list of fields denoting field information """ title: Optional[str] = field(default=None) @@ -543,8 +543,8 @@ def add_field(self, name: str, value: str, inline: Optional[bool] = False) -> No :type name: str :param value: The value of the field :type value: str - :param inline: if the field is in the same line as the previous one - :type inline: Optional[bool] + :param inline?: if the field is in the same line as the previous one + :type inline?: Optional[bool] """ fields = self.fields or [] @@ -574,8 +574,8 @@ def insert_field_at( :type name: str :param value: The value of the field :type value: str - :param inline: if the field is in the same line as the previous one - :type inline: Optional[bool] + :param inline?: if the field is in the same line as the previous one + :type inline?: Optional[bool] """ def set_field_at( @@ -590,8 +590,8 @@ def set_field_at( :type name: str :param value: The value of the field :type value: str - :param inline: if the field is in the same line as the previous one - :type inline: Optional[bool] + :param inline?: if the field is in the same line as the previous one + :type inline?: Optional[bool] """ try: @@ -642,12 +642,12 @@ def set_author( :param name: The name of the author :type name: str - :param url: Url of author - :type url: Optional[str] - :param icon_url: Url of author icon (only supports http(s) and attachments) - :type icon_url: Optional[str] - :param proxy_icon_url: A proxied url of author icon - :type proxy_icon_url: Optional[str] + :param url?: Url of author + :type url?: Optional[str] + :param icon_url?: Url of author icon (only supports http(s) and attachments) + :type icon_url?: Optional[str] + :param proxy_icon_url?: A proxied url of author icon + :type proxy_icon_url?: Optional[str] """ self.author = EmbedAuthor( @@ -662,10 +662,10 @@ def set_footer( :param text: The text of the footer :type text: str - :param icon_url: Url of footer icon (only supports http(s) and attachments) - :type icon_url: Optional[str] - :param proxy_icon_url: A proxied url of footer icon - :type proxy_icon_url: Optional[str] + :param icon_url?: Url of footer icon (only supports http(s) and attachments) + :type icon_url?: Optional[str] + :param proxy_icon_url?: A proxied url of footer icon + :type proxy_icon_url?: Optional[str] """ self.footer = EmbedFooter(text=text, icon_url=icon_url, proxy_icon_url=proxy_icon_url) @@ -682,12 +682,12 @@ def set_image( :param url: Url of the image :type url: str - :param proxy_url: A proxied url of the image - :type proxy_url: Optional[str] - :param height: The image's height - :type height: Optional[int] - :param width: The image's width - :type width: Optional[int] + :param proxy_url?: A proxied url of the image + :type proxy_url?: Optional[str] + :param height?: The image's height + :type height?: Optional[int] + :param width?: The image's width + :type width?: Optional[int] """ self.image = EmbedImageStruct(url=url, proxy_url=proxy_url, height=height, width=width) @@ -704,12 +704,12 @@ def set_video( :param url: Url of the video :type url: str - :param proxy_url: A proxied url of the video - :type proxy_url: Optional[str] - :param height: The video's height - :type height: Optional[int] - :param width: The video's width - :type width: Optional[int] + :param proxy_url?: A proxied url of the video + :type proxy_url?: Optional[str] + :param height?: The video's height + :type height?: Optional[int] + :param width?: The video's width + :type width?: Optional[int] """ self.video = EmbedImageStruct(url=url, proxy_url=proxy_url, height=height, width=width) @@ -726,12 +726,12 @@ def set_thumbnail( :param url: Url of the thumbnail :type url: str - :param proxy_url: A proxied url of the thumbnail - :type proxy_url: Optional[str] - :param height: The thumbnail's height - :type height: Optional[int] - :param width: The thumbnail's width - :type width: Optional[int] + :param proxy_url?: A proxied url of the thumbnail + :type proxy_url?: Optional[str] + :param height?: The thumbnail's height + :type height?: Optional[int] + :param width?: The thumbnail's width + :type width?: Optional[int] """ self.thumbnail = EmbedImageStruct(url=url, proxy_url=proxy_url, height=height, width=width) @@ -758,17 +758,17 @@ class Sticker(PartialSticker, IDMixin): A class object representing a full sticker apart from a partial. :ivar Snowflake id: ID of the sticker - :ivar Optional[Snowflake] pack_id: ID of the pack the sticker is from. + :ivar Optional[Snowflake] pack_id?: ID of the pack the sticker is from. :ivar str name: Name of the sticker - :ivar Optional[str] description: Description of the sticker + :ivar Optional[str] description?: Description of the sticker :ivar str tags: Autocomplete/suggestion tags for the sticker (max 200 characters) :ivar str asset: Previously a sticker asset hash, now an empty string. :ivar int type: Type of sticker :ivar int format_type: Type of sticker format - :ivar Optional[bool] available: Status denoting if this sticker can be used. (Can be false via server boosting) - :ivar Optional[Snowflake] guild_id: Guild ID that owns the sticker. - :ivar Optional[User] user: The user that uploaded the sticker. - :ivar Optional[int] sort_value: The standard sticker's sort order within its pack + :ivar Optional[bool] available?: Status denoting if this sticker can be used. (Can be false via server boosting) + :ivar Optional[Snowflake] guild_id?: Guild ID that owns the sticker. + :ivar Optional[User] user?: The user that uploaded the sticker. + :ivar Optional[int] sort_value?: The standard sticker's sort order within its pack """ id: Snowflake = field(converter=Snowflake) @@ -806,34 +806,34 @@ class Message(ClientSerializerMixin, IDMixin): :ivar Snowflake id: ID of the message. :ivar Snowflake channel_id: ID of the channel the message was sent in - :ivar Optional[Snowflake] guild_id: ID of the guild the message was sent in, if it exists. + :ivar Optional[Snowflake] guild_id?: ID of the guild the message was sent in, if it exists. :ivar User author: The author of the message. - :ivar Optional[Member] member: The member object associated with the author, if any. + :ivar Optional[Member] member?: The member object associated with the author, if any. :ivar str content: Message contents. :ivar datetime timestamp: Timestamp denoting when the message was sent. - :ivar Optional[datetime] edited_timestamp: Timestamp denoting when the message was edited, if any. + :ivar Optional[datetime] edited_timestamp?: Timestamp denoting when the message was edited, if any. :ivar bool tts: Status dictating if this was a TTS message or not. :ivar bool mention_everyone: Status dictating of this message mentions everyone - :ivar Optional[List[Union[Member, User]]] mentions: Array of user objects with an additional partial member field. - :ivar Optional[List[str]] mention_roles: Array of roles mentioned in this message - :ivar Optional[List[ChannelMention]] mention_channels: Channels mentioned in this message, if any. + :ivar Optional[List[Union[Member, User]]] mentions?: Array of user objects with an additional partial member field. + :ivar Optional[List[str]] mention_roles?: Array of roles mentioned in this message + :ivar Optional[List[ChannelMention]] mention_channels?: Channels mentioned in this message, if any. :ivar List[Attachment] attachments: An array of attachments :ivar List[Embed] embeds: An array of embeds - :ivar Optional[List[ReactionObject]] reactions: Reactions to the message. + :ivar Optional[List[ReactionObject]] reactions?: Reactions to the message. :ivar Union[int, str] nonce: Used for message validation :ivar bool pinned: Whether this message is pinned. - :ivar Optional[Snowflake] webhook_id: Webhook ID if the message is generated by a webhook. + :ivar Optional[Snowflake] webhook_id?: Webhook ID if the message is generated by a webhook. :ivar MessageType type: Type of message - :ivar Optional[MessageActivity] activity: Message activity object that's sent by Rich Presence - :ivar Optional[Application] application: Application object that's sent by Rich Presence - :ivar Optional[MessageReference] message_reference: Data showing the source of a message (crosspost, channel follow, add, pin, or replied message) + :ivar Optional[MessageActivity] activity?: Message activity object that's sent by Rich Presence + :ivar Optional[Application] application?: Application object that's sent by Rich Presence + :ivar Optional[MessageReference] message_reference?: Data showing the source of a message (crosspost, channel follow, add, pin, or replied message) :ivar Optional[Any] allowed_mentions: The allowed mentions of roles attached in the message. :ivar int flags: Message flags - :ivar Optional[MessageInteraction] interaction: Message interaction object, if the message is sent by an interaction. - :ivar Optional[Channel] thread: The thread that started from this message, if any, with a thread member object embedded. - :ivar Optional[Union[Component, List[Component]]] components: Components associated with this message, if any. - :ivar Optional[List[PartialSticker]] sticker_items: An array of message sticker item objects, if sent with them. - :ivar Optional[List[Sticker]] stickers: Array of sticker objects sent with the message if any. Deprecated. + :ivar Optional[MessageInteraction] interaction?: Message interaction object, if the message is sent by an interaction. + :ivar Optional[Channel] thread?: The thread that started from this message, if any, with a thread member object embedded. + :ivar Optional[Union[Component, List[Component]]] components?: Components associated with this message, if any. + :ivar Optional[List[PartialSticker]] sticker_items?: An array of message sticker item objects, if sent with them. + :ivar Optional[List[Sticker]] stickers?: Array of sticker objects sent with the message if any. Deprecated. """ id: Snowflake = field(converter=Snowflake) @@ -950,21 +950,21 @@ async def edit( """ This method edits a message. Only available for messages sent by the bot. - :param content: The contents of the message as a string or string-converted value. + :param content?: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param tts: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param files: A file or list of files to be attached to the message. + :param files?: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param embeds: An embed, or list of embeds for the message. + :param embeds?: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param suppress_embeds: Whether to suppress embeds in the message. + :param suppress_embeds?: Whether to suppress embeds in the message. :type suppress_embeds: Optional[bool] - :param allowed_mentions: The message interactions/mention limits that the message can refer to. + :param allowed_mentions?: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] - :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param components: A component, or list of components for the message. If `[]` the components will be removed + :param components?: A component, or list of components for the message. If `[]` the components will be removed :type components: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] :return: The edited message as an object. :rtype: Message @@ -1064,21 +1064,21 @@ async def reply( """ Sends a new message replying to the old. - :param content: The contents of the message as a string or string-converted value. + :param content?: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param tts: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param files: A file or list of files to be attached to the message. + :param files?: A file or list of files to be attached to the message. :type files: Optional[Union[File, List[File]]] - :param embeds: An embed, or list of embeds for the message. + :param embeds?: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions: The message interactions/mention limits that the message can refer to. + :param allowed_mentions?: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] - :param components: A component, or list of components for the message. + :param components?: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] - :param stickers: A list of stickers to send with your message. You can send up to 3 stickers per message. + :param stickers?: A list of stickers to send with your message. You can send up to 3 stickers per message. :type stickers: Optional[List[Sticker]] :return: The sent message as an object. :rtype: Message @@ -1175,12 +1175,12 @@ async def create_thread( :param name: The name of the thread :type name: str - :param auto_archive_duration: duration in minutes to automatically archive the thread after recent activity, + :param auto_archive_duration?: duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 :type auto_archive_duration: Optional[int] - :param invitable: Boolean to display if the Thread is open to join or private. + :param invitable?: Boolean to display if the Thread is open to join or private. :type invitable: Optional[bool] - :param reason: An optional reason for the audit log + :param reason?: An optional reason for the audit log :type reason: Optional[str] :return: The created thread :rtype: Channel diff --git a/interactions/api/models/misc.py b/interactions/api/models/misc.py index 4af73d891..ec3ced211 100644 --- a/interactions/api/models/misc.py +++ b/interactions/api/models/misc.py @@ -58,9 +58,9 @@ class ClientStatus(DictSerializerMixin): """ An object that symbolizes the status per client device per session. - :ivar Optional[str] desktop: User's status set for an active desktop application session - :ivar Optional[str] mobile: User's status set for an active mobile application session - :ivar Optional[str] web: User's status set for an active web application session + :ivar Optional[str] desktop?: User's status set for an active desktop application session + :ivar Optional[str] mobile?: User's status set for an active mobile application session + :ivar Optional[str] web?: User's status set for an active web application session """ desktop: Optional[str] = field(default=None) diff --git a/interactions/api/models/presence.py b/interactions/api/models/presence.py index 6de1747fa..ad01dde18 100644 --- a/interactions/api/models/presence.py +++ b/interactions/api/models/presence.py @@ -23,8 +23,8 @@ class PresenceParty(DictSerializerMixin): """ A class object representing the party data of a presence. - :ivar Optional[Snowflake] id: ID of the party. - :ivar Optional[List[int]] size: An array denoting the party's current and max size + :ivar Optional[Snowflake] id?: ID of the party. + :ivar Optional[List[int]] size?: An array denoting the party's current and max size """ id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -36,10 +36,10 @@ class PresenceAssets(DictSerializerMixin): """ A class object representing the assets of a presence. - :ivar Optional[str] large_image: ID for a large asset of the activity - :ivar Optional[str] large_text: Text associated with the large asset - :ivar Optional[str] small_image: ID for a small asset of the activity - :ivar Optional[str] small_text: Text associated with the small asset + :ivar Optional[str] large_image?: ID for a large asset of the activity + :ivar Optional[str] large_text?: Text associated with the large asset + :ivar Optional[str] small_image?: ID for a small asset of the activity + :ivar Optional[str] small_text?: Text associated with the small asset """ large_image: Optional[str] = field(default=None) @@ -53,9 +53,9 @@ class PresenceSecrets(DictSerializerMixin): """ A class object representing "secret" join information of a presence. - :ivar Optional[str] join: Join secret - :ivar Optional[str] spectate: Spectate secret - :ivar Optional[str] match: Instanced match secret + :ivar Optional[str] join?: Join secret + :ivar Optional[str] spectate?: Spectate secret + :ivar Optional[str] match?: Instanced match secret """ join: Optional[str] = field(default=None) @@ -68,8 +68,8 @@ class PresenceTimestamp(DictSerializerMixin): """ A class object representing the timestamp data of a presence. - :ivar Optional[int] start: Unix time in ms when the activity started - :ivar Optional[int] end: Unix time in ms when the activity ended + :ivar Optional[int] start?: Unix time in ms when the activity started + :ivar Optional[int] end?: Unix time in ms when the activity ended """ start: Optional[int] = field(default=None) @@ -103,19 +103,19 @@ class PresenceActivity(DictSerializerMixin): :ivar str name: The activity name :ivar Union[int, PresenceActivityType] type: The activity type - :ivar Optional[str] url: stream url (if type is 1) + :ivar Optional[str] url?: stream url (if type is 1) :ivar int created_at: Unix timestamp (in milliseconds) of when the activity was added to the user's session - :ivar Optional[PresenceTimestamp] timestamps: Unix timestamps for start and/or end of the game - :ivar Optional[Snowflake] application_id: Application ID for the game - :ivar Optional[str] details: What the player is currently doing - :ivar Optional[str] state: Current party status - :ivar Optional[Emoji] emoji: The emoji used for the custom status - :ivar Optional[PresenceParty] party: Info for the current players' party - :ivar Optional[PresenceAssets] assets: Images for the presence and their associated hover texts - :ivar Optional[PresenceSecrets] secrets: for RPC join/spectate - :ivar Optional[bool] instance: A status denoting if the activity is a game session - :ivar Optional[int] flags: activity flags - :ivar Optional[List[str]] buttons: Custom button labels shown in the status, if any. + :ivar Optional[PresenceTimestamp] timestamps?: Unix timestamps for start and/or end of the game + :ivar Optional[Snowflake] application_id?: Application ID for the game + :ivar Optional[str] details?: What the player is currently doing + :ivar Optional[str] state?: Current party status + :ivar Optional[Emoji] emoji?: The emoji used for the custom status + :ivar Optional[PresenceParty] party?: Info for the current players' party + :ivar Optional[PresenceAssets] assets?: Images for the presence and their associated hover texts + :ivar Optional[PresenceSecrets] secrets?: for RPC join/spectate + :ivar Optional[bool] instance?: A status denoting if the activity is a game session + :ivar Optional[int] flags?: activity flags + :ivar Optional[List[str]] buttons?: Custom button labels shown in the status, if any. """ name: str = field() @@ -163,7 +163,7 @@ class ClientPresence(DictSerializerMixin): """ An object that symbolizes the presence of the current client's session upon creation. - :ivar Optional[int] since: Unix time in milliseconds of when the client went idle. None if it is not idle. + :ivar Optional[int] since?: Unix time in milliseconds of when the client went idle. None if it is not idle. :ivar Optional[List[PresenceActivity]] activities: Array of activity objects. :ivar Union[str, StatusType] status: The client's new status. :ivar bool afk: Whether the client is afk or not. diff --git a/interactions/api/models/role.py b/interactions/api/models/role.py index 4dd9b34fc..05c49fe3c 100644 --- a/interactions/api/models/role.py +++ b/interactions/api/models/role.py @@ -18,9 +18,9 @@ class RoleTags(DictSerializerMixin): """ A class object representing the tags of a role. - :ivar Optional[Snowflake] bot_id: The id of the bot this role belongs to - :ivar Optional[Snowflake] integration_id: The id of the integration this role belongs to - :ivar Optional[Any] premium_subscriber: Whether if this is the guild's premium subscriber role + :ivar Optional[Snowflake] bot_id?: The id of the bot this role belongs to + :ivar Optional[Snowflake] integration_id?: The id of the integration this role belongs to + :ivar Optional[Any] premium_subscriber?: Whether if this is the guild's premium subscriber role """ bot_id: Optional[Snowflake] = field(converter=Snowflake, default=None) @@ -39,13 +39,13 @@ class Role(ClientSerializerMixin, IDMixin): :ivar str name: Role name :ivar int color: Role color in integer representation :ivar bool hoist: A status denoting if this role is hoisted - :ivar Optional[str] icon: Role icon hash, if any. - :ivar Optional[str] unicode_emoji: Role unicode emoji + :ivar Optional[str] icon?: Role icon hash, if any. + :ivar Optional[str] unicode_emoji?: Role unicode emoji :ivar int position: Role position :ivar str permissions: Role permissions as a bit set :ivar bool managed: A status denoting if this role is managed by an integration :ivar bool mentionable: A status denoting if this role is mentionable - :ivar Optional[RoleTags] tags: The tags this role has + :ivar Optional[RoleTags] tags?: The tags this role has """ id: Snowflake = field(converter=Snowflake) @@ -109,21 +109,21 @@ async def modify( :param guild_id: The id of the guild to edit the role on :type guild_id: int - :param name: The name of the role, defaults to the current value of the role + :param name?: The name of the role, defaults to the current value of the role :type name: Optional[str] - :param color: RGB color value as integer, defaults to the current value of the role + :param color?: RGB color value as integer, defaults to the current value of the role :type color: Optional[int] - :param permissions: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role + :param permissions?: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role :type permissions: Optional[int] - :param hoist: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role + :param hoist?: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role :type hoist: Optional[bool] - :param icon: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role + :param icon?: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role :type icon: Optional[Image] - :param unicode_emoji: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role + :param unicode_emoji?: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role :type unicode_emoji: Optional[str] - :param mentionable: Whether the role should be mentionable, defaults to the current value of the role + :param mentionable?: Whether the role should be mentionable, defaults to the current value of the role :type mentionable: Optional[bool] - :param reason: The reason why the role is edited, default ``None`` + :param reason?: The reason why the role is edited, default ``None`` :type reason: Optional[str] :return: The modified role object :rtype: Role @@ -173,7 +173,7 @@ async def modify_position( :type guild_id: int :param position: The new position of the role :type position: int - :param reason: The reason for the modifying + :param reason?: The reason for the modifying :type reason: Optional[str] :return: List of guild roles with updated hierarchy :rtype: List[Role] diff --git a/interactions/api/models/team.py b/interactions/api/models/team.py index ac4fa89d8..e4bf3a827 100644 --- a/interactions/api/models/team.py +++ b/interactions/api/models/team.py @@ -38,7 +38,7 @@ class Team(ClientSerializerMixin, IDMixin): """ A class object representing a team. - :ivar Optional[str] icon: The hash of the team's icon + :ivar Optional[str] icon?: The hash of the team's icon :ivar Snowflake id: The team's unique ID :ivar List[TeamMember] members: The members of the team :ivar str name: The team name @@ -62,22 +62,22 @@ class Application(ClientSerializerMixin, IDMixin): :ivar Snowflake id: Application ID :ivar str name: Application Name - :ivar Optional[str] icon: Icon hash of the application + :ivar Optional[str] icon?: Icon hash of the application :ivar str description: Application Description - :ivar Optional[List[str]] rpc_origins: An array of rpc origin urls, if RPC is used. + :ivar Optional[List[str]] rpc_origins?: An array of rpc origin urls, if RPC is used. :ivar bool bot_public: A status denoting if anyone can invite the bot to guilds :ivar bool bot_require_code_grant: A status denoting whether full Oauth2 is required for the app's bot to join a guild - :ivar Optional[str] terms_of_service_url: URL of the app's Terms of Service - :ivar Optional[str] privacy_policy_url: URL of the app's Privacy Policy - :ivar Optional[User] owner: User object of the owner + :ivar Optional[str] terms_of_service_url?: URL of the app's Terms of Service + :ivar Optional[str] privacy_policy_url?: URL of the app's Privacy Policy + :ivar Optional[User] owner?: User object of the owner :ivar str summary: Summary of the store page, if this application is a game sold on Discord :ivar str verify_key: Hex encoded key for verification in interactions and/or the GameSDK's GetTicket - :ivar Optional[Team] team: A list of team members, if this app belongs to a team. - :ivar Optional[Snowflake] guild_id: Guild ID linked, if this app is a game sold on Discord - :ivar Optional[int] primary_sku_id: Game SKU ID, if this app is a game sold on Discord - :ivar Optional[str] slug: URL slug that links to the store page, if this app is a game sold on Discord - :ivar Optional[str] cover_image: The app's default rich presence invite cover image - :ivar Optional[AppFlags] flags: The application's public flags + :ivar Optional[Team] team?: A list of team members, if this app belongs to a team. + :ivar Optional[Snowflake] guild_id?: Guild ID linked, if this app is a game sold on Discord + :ivar Optional[int] primary_sku_id?: Game SKU ID, if this app is a game sold on Discord + :ivar Optional[str] slug?: URL slug that links to the store page, if this app is a game sold on Discord + :ivar Optional[str] cover_image?: The app's default rich presence invite cover image + :ivar Optional[AppFlags] flags?: The application's public flags """ id: Snowflake = field(converter=Snowflake) diff --git a/interactions/api/models/user.py b/interactions/api/models/user.py index 8642a9b91..84e608ded 100644 --- a/interactions/api/models/user.py +++ b/interactions/api/models/user.py @@ -15,19 +15,19 @@ class User(ClientSerializerMixin, IDMixin): :ivar Snowflake id: The User ID :ivar str username: The Username associated (not necessarily unique across the platform) :ivar str discriminator: The User's 4-digit discord-tag (i.e.: XXXX) - :ivar Optional[str] avatar: The user's avatar hash, if any - :ivar Optional[bool] bot: A status denoting if the user is a bot - :ivar Optional[bool] system: A status denoting if the user is an Official Discord System user - :ivar Optional[bool] mfa_enabled: A status denoting if the user has 2fa on their account - :ivar Optional[str] banner: The user's banner hash, if any - :ivar Optional[str] banner_color: The user's banner color as a hex, if any - :ivar Optional[int] accent_color: The user's banner color as an integer represented of hex color codes - :ivar Optional[str] locale: The user's chosen language option - :ivar Optional[bool] verified: Whether the email associated with this account has been verified - :ivar Optional[str] email: The user's email, if any - :ivar Optional[UserFlags] flags: The user's flags - :ivar Optional[int] premium_type: The type of Nitro subscription the user has - :ivar Optional[UserFlags] public_flags: The user's public flags + :ivar Optional[str] avatar?: The user's avatar hash, if any + :ivar Optional[bool] bot?: A status denoting if the user is a bot + :ivar Optional[bool] system?: A status denoting if the user is an Official Discord System user + :ivar Optional[bool] mfa_enabled?: A status denoting if the user has 2fa on their account + :ivar Optional[str] banner?: The user's banner hash, if any + :ivar Optional[str] banner_color?: The user's banner color as a hex, if any + :ivar Optional[int] accent_color?: The user's banner color as an integer represented of hex color codes + :ivar Optional[str] locale?: The user's chosen language option + :ivar Optional[bool] verified?: Whether the email associated with this account has been verified + :ivar Optional[str] email?: The user's email, if any + :ivar Optional[UserFlags] flags?: The user's flags + :ivar Optional[int] premium_type?: The type of Nitro subscription the user has + :ivar Optional[UserFlags] public_flags?: The user's public flags """ id: Snowflake = field(converter=Snowflake, repr=True) diff --git a/interactions/api/models/webhook.py b/interactions/api/models/webhook.py index 78bca6684..743da4b34 100644 --- a/interactions/api/models/webhook.py +++ b/interactions/api/models/webhook.py @@ -30,16 +30,16 @@ class Webhook(ClientSerializerMixin, IDMixin): :ivar Snowflake id: the id of the webhook :ivar WebhookType type: the type of the webhook - :ivar Snowflake guild_id: the guild id this webhook is for, if any - :ivar Snowflake channel_id: the channel id this webhook is for, if any - :ivar User user: the user this webhook was created by (not returned when getting a webhook with its token) + :ivar Snowflake guild_id?: the guild id this webhook is for, if any + :ivar Snowflake channel_id?: the channel id this webhook is for, if any + :ivar User user?: the user this webhook was created by (not returned when getting a webhook with its token) :ivar str name: the default name of the webhook :ivar str avatar: the default user avatar hash of the webhook :ivar str token: the secure token of the webhook (returned for Incoming Webhooks) :ivar Snowflake application_id: the bot/OAuth2 application that created this webhook - :ivar Guild source_guild: the guild of the channel that this webhook is following (returned for Channel Follower Webhooks) - :ivar Channel source_channel: the channel that this webhook is following (returned for Channel Follower Webhooks) - :ivar str url: the url used for executing the webhook (returned by the webhooks OAuth2 flow) + :ivar Guild source_guild?: the guild of the channel that this webhook is following (returned for Channel Follower Webhooks) + :ivar Channel source_channel?: the channel that this webhook is following (returned for Channel Follower Webhooks) + :ivar str url?: the url used for executing the webhook (returned by the webhooks OAuth2 flow) """ id: Snowflake = field(converter=Snowflake) @@ -209,7 +209,7 @@ async def execute( :type avatar_url: str :param tts: true if this is a TTS message :type tts: bool - :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] :param embeds: embedded ``rich`` content :type embeds: Union[Embed, List[Embed]] diff --git a/interactions/client/bot.py b/interactions/client/bot.py index ca4592b61..a7f8819e1 100644 --- a/interactions/client/bot.py +++ b/interactions/client/bot.py @@ -49,15 +49,15 @@ class Client: :param token: The token of the application for authentication and connection. :type token: str - :param intents: Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to ``Intents.DEFAULT``. + :param intents?: Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to ``Intents.DEFAULT``. :type intents: Optional[Intents] - :param shards: Dictates and controls the shards that the application connects under. + :param shards?: Dictates and controls the shards that the application connects under. :type shards: Optional[List[Tuple[int]]] - :param presence: Sets an RPC-like presence on the application when connected to the Gateway. + :param presence?: Sets an RPC-like presence on the application when connected to the Gateway. :type presence: Optional[ClientPresence] - :param default_scope: Sets the default scope of all commands. + :param default_scope?: Sets the default scope of all commands. :type default_scope: Optional[Union[int, Guild, List[int], List[Guild]]] - :param disable_sync: Controls whether synchronization in the user-facing API should be automatic or not. + :param disable_sync?: Controls whether synchronization in the user-facing API should be automatic or not. :type disable_sync: Optional[bool] :ivar AbstractEventLoop _loop: The asynchronous event loop of the client. @@ -960,25 +960,25 @@ async def sudo(ctx): .. note:: If ``default_member_permissions`` is not given, this will default to anyone that is able to use the command. - :param type: The type of application command. Defaults to :meth:`interactions.enums.ApplicationCommandType.CHAT_INPUT` or ``1``. + :param type?: The type of application command. Defaults to :meth:`interactions.enums.ApplicationCommandType.CHAT_INPUT` or ``1``. :type type: Optional[Union[str, int, ApplicationCommandType]] :param name: The name of the application command. This *is* required but kept optional to follow kwarg rules. :type name: Optional[str] - :param description: The description of the application command. This should be left blank if you are not using ``CHAT_INPUT``. + :param description?: The description of the application command. This should be left blank if you are not using ``CHAT_INPUT``. :type description: Optional[str] - :param scope: The "scope"/applicable guilds the application command applies to. + :param scope?: The "scope"/applicable guilds the application command applies to. :type scope: Optional[Union[int, Guild, List[int], List[Guild]]] - :param options: The "arguments"/options of an application command. This should be left blank if you are not using ``CHAT_INPUT``. + :param options?: The "arguments"/options of an application command. This should be left blank if you are not using ``CHAT_INPUT``. :type options: Optional[Union[Dict[str, Any], List[Dict[str, Any]], Option, List[Option]]] - :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param description_localizations: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. + :param description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. :type description_localizations: Optional[Dict[Union[str, Locale], str]] - :param default_member_permissions: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` + :param default_member_permissions?: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` :type default_member_permissions: Optional[Union[int, Permissions]] - :param dm_permission: The application permissions if executed in a Direct Message. Defaults to ``True``. + :param dm_permission?: The application permissions if executed in a Direct Message. Defaults to ``True``. :type dm_permission: Optional[bool] - :param default_scope: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. + :param default_scope?: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. :type default_scope: bool :return: A callable response. :rtype: Callable[[Callable[..., Coroutine]], Command] @@ -1031,17 +1031,17 @@ async def context_menu_name(ctx): :param name: The name of the application command. :type name: Optional[str] - :param scope: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. + :param scope?: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. :type scope: Optional[Union[int, Guild, List[int], List[Guild]]] - :param default_permission: The default permission of accessibility for the application command. Defaults to ``True``. + :param default_permission?: The default permission of accessibility for the application command. Defaults to ``True``. :type default_permission: Optional[bool] - :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param default_member_permissions: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` + :param default_member_permissions?: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` :type default_member_permissions: Optional[Union[int, Permissions]] - :param dm_permission: The application permissions if executed in a Direct Message. Defaults to ``True``. + :param dm_permission?: The application permissions if executed in a Direct Message. Defaults to ``True``. :type dm_permission: Optional[bool] - :param default_scope: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. + :param default_scope?: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. :type default_scope: bool :return: A callable response. :rtype: Callable[[Callable[..., Coroutine]], Command] @@ -1088,17 +1088,17 @@ async def context_menu_name(ctx): :param name: The name of the application command. :type name: Optional[str] - :param scope: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. + :param scope?: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. :type scope: Optional[Union[int, Guild, List[int], List[Guild]]] - :param default_permission: The default permission of accessibility for the application command. Defaults to ``True``. + :param default_permission?: The default permission of accessibility for the application command. Defaults to ``True``. :type default_permission: Optional[bool] - :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param default_member_permissions: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` + :param default_member_permissions?: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` :type default_member_permissions: Optional[Union[int, Permissions]] - :param dm_permission: The application permissions if executed in a Direct Message. Defaults to ``True``. + :param dm_permission?: The application permissions if executed in a Direct Message. Defaults to ``True``. :type dm_permission: Optional[bool] - :param default_scope: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. + :param default_scope?: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. :type default_scope: bool :return: A callable response. :rtype: Callable[[Callable[..., Coroutine]], Command] @@ -1297,11 +1297,11 @@ def load( :param name: The name of the extension. :type name: str - :param package: The package of the extension. + :param package?: The package of the extension. :type package: Optional[str] - :param \*args: Optional arguments to pass to the extension + :param \*args?: Optional arguments to pass to the extension :type \**args: tuple - :param \**kwargs: Optional keyword-only arguments to pass to the extension. + :param \**kwargs?: Optional keyword-only arguments to pass to the extension. :type \**kwargs: dict :return: The loaded extension. :rtype: Optional[Extension] @@ -1336,9 +1336,9 @@ def remove( :param name: The name of the extension. :type name: str - :param remove_commands: Whether to remove commands before reloading. Defaults to True. + :param remove_commands?: Whether to remove commands before reloading. Defaults to True. :type remove_commands: bool - :param package: The package of the extension. + :param package?: The package of the extension. :type package: Optional[str] """ try: @@ -1392,13 +1392,13 @@ def reload( :param name: The name of the extension :type name: str - :param package: The package of the extension + :param package?: The package of the extension :type package: Optional[str] - :param remove_commands: Whether to remove commands before reloading. Defaults to True + :param remove_commands?: Whether to remove commands before reloading. Defaults to True :type remove_commands: bool - :param \*args: Optional arguments to pass to the extension + :param \*args?: Optional arguments to pass to the extension :type \**args: tuple - :param \**kwargs: Optional keyword-only arguments to pass to the extension. + :param \**kwargs?: Optional keyword-only arguments to pass to the extension. :type \**kwargs: dict :return: The reloaded extension. :rtype: Optional[Extension] @@ -1424,10 +1424,10 @@ async def modify( """ Modify the bot user account settings. - :param username: The new username of the bot - :type username: Optional[str] - :param avatar: The new avatar of the bot - :type avatar: Optional[Image] + :param username?: The new username of the bot + :type username?: Optional[str] + :param avatar?: The new avatar of the bot + :type avatar?: Optional[Image] :return: The modified User object :rtype: User """ diff --git a/interactions/client/context.py b/interactions/client/context.py index 79ae8eeb0..ab78a5396 100644 --- a/interactions/client/context.py +++ b/interactions/client/context.py @@ -35,7 +35,7 @@ class _Context(ClientSerializerMixin): easily access information presented from any event in a "contextualized" sense. - :ivar Optional[Message] message: The message data model. + :ivar Optional[Message] message?: The message data model. :ivar Member author: The member data model. :ivar User user: The user data model. :ivar Optional[Channel] channel: The channel data model. @@ -119,19 +119,19 @@ async def send( This allows the invocation state described in the "context" to send an interaction response. - :param content: The contents of the message as a string or string-converted value. + :param content?: The contents of the message as a string or string-converted value. :type content: Optional[str] - :param tts: Whether the message utilizes the text-to-speech Discord programme or not. + :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. :type tts: Optional[bool] - :param attachments: The attachments to attach to the message. Needs to be uploaded to the CDN first + :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first :type attachments: Optional[List[Attachment]] - :param embeds: An embed, or list of embeds for the message. + :param embeds?: An embed, or list of embeds for the message. :type embeds: Optional[Union[Embed, List[Embed]]] - :param allowed_mentions: The message interactions/mention limits that the message can refer to. + :param allowed_mentions?: The message interactions/mention limits that the message can refer to. :type allowed_mentions: Optional[MessageInteraction] - :param components: A component, or list of components for the message. + :param components?: A component, or list of components for the message. :type components: Optional[Union[ActionRow, Button, SelectMenu, List[Union[ActionRow, Button, SelectMenu]]]] - :param ephemeral: Whether the response is hidden or not. + :param ephemeral?: Whether the response is hidden or not. :type ephemeral: Optional[bool] :return: The sent message as an object. :rtype: Message @@ -315,16 +315,16 @@ class CommandContext(_Context): :ivar Snowflake id: The ID of the interaction. :ivar Snowflake application_id: The application ID of the interaction. :ivar InteractionType type: The type of interaction. - :ivar InteractionData data: The application command data. + :ivar InteractionData data?: The application command data. :ivar Optional[Union[Message, Member, User]] target: The target selected if this interaction is invoked as a context menu. :ivar str token: The token of the interaction response. - :ivar Snowflake guild_id: The ID of the current guild. - :ivar Snowflake channel_id: The ID of the current channel. + :ivar Snowflake guild_id?: The ID of the current guild. + :ivar Snowflake channel_id?: The ID of the current channel. :ivar bool responded: Whether an original response was made or not. :ivar bool deferred: Whether the response was deferred or not. - :ivar str locale: The selected language of the user invoking the interaction. - :ivar str guild_locale: The guild's preferred language, if invoked in a guild. - :ivar str app_permissions: Bitwise set of permissions the bot has within the channel the interaction was sent from. + :ivar str locale?: The selected language of the user invoking the interaction. + :ivar str guild_locale?: The guild's preferred language, if invoked in a guild. + :ivar str app_permissions?: Bitwise set of permissions the bot has within the channel the interaction was sent from. """ target: Optional[Union[Message, Member, User]] = field(default=None) @@ -410,7 +410,7 @@ async def defer(self, ephemeral: Optional[bool] = False) -> None: This "defers" an interaction response, allowing up to a 15-minute delay between invocation and responding. - :param ephemeral: Whether the deferred state is hidden or not. + :param ephemeral?: Whether the deferred state is hidden or not. :type ephemeral: Optional[bool] """ if not self.responded: @@ -630,9 +630,9 @@ async def defer( This "defers" a component response, allowing up to a 15-minute delay between invocation and responding. - :param ephemeral: Whether the deferred state is hidden or not. + :param ephemeral?: Whether the deferred state is hidden or not. :type ephemeral: Optional[bool] - :param edit_origin: Whether you want to edit the original message or send a followup message + :param edit_origin?: Whether you want to edit the original message or send a followup message :type edit_origin: Optional[bool] """ if not self.responded: diff --git a/interactions/client/models/command.py b/interactions/client/models/command.py index 92de550a4..601dbeb0f 100644 --- a/interactions/client/models/command.py +++ b/interactions/client/models/command.py @@ -46,7 +46,7 @@ class Choice(DictSerializerMixin): :ivar str name: The name of the choice. :ivar Union[str, int, float] value: The returned value of the choice. - :ivar Optional[Dict[Union[str, Locale], str]] name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :ivar Optional[Dict[Union[str, Locale], str]] name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. """ name: str = field() @@ -96,16 +96,16 @@ class Option(DictSerializerMixin): :ivar str name: The name of the option. :ivar str description: The description of the option. :ivar bool focused: Whether the option is currently being autocompleted or not. - :ivar Optional[bool] required: Whether the option has to be filled out. - :ivar Optional[str] value: The value that's currently typed out, if autocompleting. - :ivar Optional[List[Choice]] choices: The list of choices to select from. - :ivar Optional[List[Option]] options: The list of subcommand options included. - :ivar Optional[List[ChannelType]] channel_types: Restrictive shown channel types, if given. - :ivar Optional[int] min_value: The minimum value supported by the option. - :ivar Optional[int] max_value: The maximum value supported by the option. - :ivar Optional[bool] autocomplete: A status denoting whether this option is an autocomplete option. - :ivar Optional[Dict[Union[str, Locale], str]] name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. - :ivar Optional[Dict[Union[str, Locale], str]] description_localizations: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. + :ivar Optional[bool] required?: Whether the option has to be filled out. + :ivar Optional[str] value?: The value that's currently typed out, if autocompleting. + :ivar Optional[List[Choice]] choices?: The list of choices to select from. + :ivar Optional[List[Option]] options?: The list of subcommand options included. + :ivar Optional[List[ChannelType]] channel_types?: Restrictive shown channel types, if given. + :ivar Optional[int] min_value?: The minimum value supported by the option. + :ivar Optional[int] max_value?: The maximum value supported by the option. + :ivar Optional[bool] autocomplete?: A status denoting whether this option is an autocomplete option. + :ivar Optional[Dict[Union[str, Locale], str]] name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :ivar Optional[Dict[Union[str, Locale], str]] description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. :ivar Optional[str] converter: How the option value is passed to the function, if different than ``name`` """ @@ -181,12 +181,12 @@ class ApplicationCommand(DictSerializerMixin): :ivar Snowflake id: The ID of the application command. :ivar ApplicationCommandType type: The application command type. - :ivar Optional[Snowflake] application_id: The general application ID of the command itself. - :ivar Optional[Snowflake] guild_id: The guild ID of the application command. + :ivar Optional[Snowflake] application_id?: The general application ID of the command itself. + :ivar Optional[Snowflake] guild_id?: The guild ID of the application command. :ivar str name: The name of the application command. :ivar str description: The description of the application command. - :ivar Optional[List[Option]] options: The "options"/arguments of the application command. - :ivar Optional[bool] default_permission: The default permission accessibility state of the application command. + :ivar Optional[List[Option]] options?: The "options"/arguments of the application command. + :ivar Optional[bool] default_permission?: The default permission accessibility state of the application command. :ivar int version: The Application Command version autoincrement identifier. :ivar str default_member_permissions: The default member permission state of the application command. :ivar boolean dm_permission: The application permissions if executed in a Direct Message. @@ -232,7 +232,7 @@ async def my_command(ctx, opt: str): :type option_type: OptionType :param name: The name of the option. :type name: str - :param description: The description of the option. Defaults to ``"No description set"``. + :param description?: The description of the option. Defaults to ``"No description set"``. :type description: str :param \**kwargs: The keyword arguments of the option, same as :class:`Option`. :type \**kwargs: dict @@ -523,17 +523,17 @@ async def subcommand_group(ctx): If you want to create both subcommands and subcommands with groups, first create the subcommands without groups, then create the subcommands with groups. - :param group: The name of the group the subcommand belongs to. Defaults to the most recently used group. + :param group?: The name of the group the subcommand belongs to. Defaults to the most recently used group. :type group: Optional[str] - :param name: The name of the subcommand. Defaults to the name of the coroutine. + :param name?: The name of the subcommand. Defaults to the name of the coroutine. :type name: Optional[str] - :param description: The description of the subcommand. Defaults to the docstring of the coroutine. + :param description?: The description of the subcommand. Defaults to the docstring of the coroutine. :type description: Optional[str] - :param options: The options of the subcommand. + :param options?: The options of the subcommand. :type options: Optional[List[Option]] - :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param description_localizations: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. + :param description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. :type description_localizations: Optional[Dict[Union[str, Locale], str]] :return: The :class:`interactions.client.models.command.Command` object. :rtype: Command @@ -630,13 +630,13 @@ async def subcommand_group(ctx): If you want to create both subcommands and subcommands with groups, first create the subcommands without groups, then create the subcommands with groups. - :param name: The name of the group. Defaults to the name of the coroutine. + :param name?: The name of the group. Defaults to the name of the coroutine. :type name: Optional[str] - :param description: The description of the group. Defaults to the docstring of the coroutine. + :param description?: The description of the group. Defaults to the docstring of the coroutine. :type description: Optional[str] - :param name_localizations: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. + :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. :type name_localizations: Optional[Dict[Union[str, Locale], str]] - :param description_localizations: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. + :param description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. :type description_localizations: Optional[Dict[Union[str, Locale], str]] :return: The :class:`interactions.client.models.command.Command` object. :rtype: Command @@ -739,7 +739,7 @@ def autocomplete( """ Decorator for creating an autocomplete for the command. - :param name: The name of the option to autocomplete. Defaults to the name of the coroutine. + :param name?: The name of the option to autocomplete. Defaults to the name of the coroutine. :type name: Optional[str] :return: The coroutine :rtype: Callable[..., Coroutine] diff --git a/interactions/client/models/component.py b/interactions/client/models/component.py index 7e78196c2..c95ab9bb8 100644 --- a/interactions/client/models/component.py +++ b/interactions/client/models/component.py @@ -50,9 +50,9 @@ class SelectOption(ComponentMixin): ) :ivar str label: The label of the select option. :ivar str value: The returned value of the select option. - :ivar Optional[str] description: The description of the select option. - :ivar Optional[Emoji] emoji: The emoji used alongside the label of the select option. - :ivar Optional[bool] default: Whether the select option is the default for the select menu. + :ivar Optional[str] description?: The description of the select option. + :ivar Optional[Emoji] emoji?: The emoji used alongside the label of the select option. + :ivar Optional[bool] default?: Whether the select option is the default for the select menu. """ label: str = field() @@ -79,10 +79,10 @@ class SelectMenu(ComponentMixin): :ivar ComponentType type: The type of select menu. Always defaults to ``3``. :ivar str custom_id: The customized "ID" of the select menu. :ivar List[SelectOption] options: The list of select options in the select menu. - :ivar Optional[str] placeholder: The placeholder of the select menu. - :ivar Optional[int] min_values: The minimum "options"/values to choose from the component. - :ivar Optional[int] max_values: The maximum "options"/values to choose from the component. - :ivar Optional[bool] disabled: Whether the select menu is unable to be used. + :ivar Optional[str] placeholder?: The placeholder of the select menu. + :ivar Optional[int] min_values?: The minimum "options"/values to choose from the component. + :ivar Optional[int] max_values?: The maximum "options"/values to choose from the component. + :ivar Optional[bool] disabled?: Whether the select menu is unable to be used. """ type: ComponentType = field(converter=ComponentType, default=ComponentType.SELECT) @@ -111,10 +111,10 @@ class Button(ComponentMixin): :ivar ComponentType type: The type of button. Always defaults to ``2``. :ivar ButtonStyle style: The style of the button. :ivar str label: The label of the button. - :ivar Optional[Emoji] emoji: The emoji used alongside the label of the button. - :ivar Optional[str] custom_id: The customized "ID" of the button. - :ivar Optional[str] url: The URL route/path of the button. - :ivar Optional[bool] disabled: Whether the button is unable to be used. + :ivar Optional[Emoji] emoji?: The emoji used alongside the label of the button. + :ivar Optional[str] custom_id?: The customized "ID" of the button. + :ivar Optional[str] url?: The URL route/path of the button. + :ivar Optional[bool] disabled?: Whether the button is unable to be used. """ type: ComponentType = field(converter=ComponentType, default=ComponentType.BUTTON) @@ -144,21 +144,21 @@ class Component(ComponentMixin): back information involving a component. Do not use this object for sending. :ivar ComponentType type: The type of component. - :ivar Optional[str] custom_id: The customized "ID" of the component. - :ivar Optional[bool] disabled: Whether the component is unable to be used. - :ivar Optional[ButtonStyle] style: The style of the component. - :ivar Optional[str] label: The label of the component. - :ivar Optional[Emoji] emoji: The emoji used alongside the label of the component. - :ivar Optional[str] url: The URl route/path of the component. - :ivar Optional[List[SelectMenu]] options: The "choices"/options of the component. - :ivar Optional[str] placeholder: The placeholder text/value of the component. - :ivar Optional[int] min_values: The minimum "options"/values to choose from the component. - :ivar Optional[int] max_values: The maximum "options"/values to choose from the component. - :ivar Optional[List[Component]] components: A list of components nested in the component. - :ivar Optional[int] min_length: The minimum input length to choose from the component. - :ivar Optional[int] max_length: The maximum input length to choose from the component. - :ivar Optional[bool] required: Whether this component is required to be filled. - :ivar Optional[str] value: The pre-filled value of the component. + :ivar Optional[str] custom_id?: The customized "ID" of the component. + :ivar Optional[bool] disabled?: Whether the component is unable to be used. + :ivar Optional[ButtonStyle] style?: The style of the component. + :ivar Optional[str] label?: The label of the component. + :ivar Optional[Emoji] emoji?: The emoji used alongside the label of the component. + :ivar Optional[str] url?: The URl route/path of the component. + :ivar Optional[List[SelectMenu]] options?: The "choices"/options of the component. + :ivar Optional[str] placeholder?: The placeholder text/value of the component. + :ivar Optional[int] min_values?: The minimum "options"/values to choose from the component. + :ivar Optional[int] max_values?: The maximum "options"/values to choose from the component. + :ivar Optional[List[Component]] components?: A list of components nested in the component. + :ivar Optional[int] min_length?: The minimum input length to choose from the component. + :ivar Optional[int] max_length?: The maximum input length to choose from the component. + :ivar Optional[bool] required?: Whether this component is required to be filled. + :ivar Optional[str] value?: The pre-filled value of the component. """ type: ComponentType = field(converter=ComponentType) @@ -205,10 +205,10 @@ class TextInput(ComponentMixin): :ivar str custom_id: The custom Id of the input. :ivar str label: The label of the input. :ivar Optional[str] value: The pre-filled value of the input. - :ivar Optional[bool] required: Whether the input is required or not. - :ivar Optional[str] placeholder: The placeholder of the input. - :ivar Optional[int] min_length: The minimum length of the input. - :ivar Optional[int] max_length: The maximum length of the input. + :ivar Optional[bool] required?: Whether the input is required or not. + :ivar Optional[str] placeholder?: The placeholder of the input. + :ivar Optional[int] min_length?: The minimum length of the input. + :ivar Optional[int] max_length?: The maximum length of the input. """ type: ComponentType = field(converter=ComponentType, default=ComponentType.INPUT_TEXT) @@ -274,7 +274,7 @@ class ActionRow(ComponentMixin): interactions.ActionRow(components=[...]) :ivar int type: The type of component. Always defaults to ``1``. - :ivar Optional[List[Component]] components: A list of components the ActionRow has, if any. + :ivar Optional[List[Component]] components?: A list of components the ActionRow has, if any. """ type: ComponentType = field(ComponentType, default=ComponentType.ACTION_ROW) diff --git a/interactions/client/models/misc.py b/interactions/client/models/misc.py index a495706c5..40c223c0e 100644 --- a/interactions/client/models/misc.py +++ b/interactions/client/models/misc.py @@ -49,12 +49,12 @@ class InteractionData(DictSerializerMixin): :ivar str id: The ID of the interaction data. :ivar str name: The name of the interaction. :ivar ApplicationCommandType type: The type of command from the interaction. - :ivar Optional[InteractionResolvedData] resolved: The resolved version of the data. - :ivar Optional[Option, List[Option]] options: The options of the interaction. - :ivar Optional[str] custom_id: The custom ID of the interaction. - :ivar Optional[ComponentType] component_type: The type of component from the interaction. - :ivar Optional[List[str]] values: The values of the selected options in the interaction. - :ivar Optional[str] target_id: The targeted ID of the interaction. + :ivar Optional[InteractionResolvedData] resolved?: The resolved version of the data. + :ivar Optional[Option, List[Option]] options?: The options of the interaction. + :ivar Optional[str] custom_id?: The custom ID of the interaction. + :ivar Optional[ComponentType] component_type?: The type of component from the interaction. + :ivar Optional[List[str]] values?: The values of the selected options in the interaction. + :ivar Optional[str] target_id?: The targeted ID of the interaction. """ id: Snowflake = field(converter=Snowflake, default=None) @@ -79,14 +79,14 @@ class Interaction(DictSerializerMixin): :ivar str id: The ID of the interaction. :ivar str application_id: The application's ID of the interaction. :ivar InteractionType type: The type of interaction. - :ivar Optional[InteractionData] data: The data of the interaction. - :ivar Optional[str] guild_id: The guild ID of the interaction. - :ivar Optional[str] channel_id: The channel ID of the interaction. - :ivar Optional[Member] member: The member who invoked the interaction. - :ivar Optional[User] user: The user who invoked the interaction. + :ivar Optional[InteractionData] data?: The data of the interaction. + :ivar Optional[str] guild_id?: The guild ID of the interaction. + :ivar Optional[str] channel_id?: The channel ID of the interaction. + :ivar Optional[Member] member?: The member who invoked the interaction. + :ivar Optional[User] user?: The user who invoked the interaction. :ivar str token: The token of the interaction. :ivar version: The version of the interaction as an autoincrement identifier. - :ivar Optional[Message] message: The message of the interaction. + :ivar Optional[Message] message?: The message of the interaction. """ id: Snowflake = field(converter=Snowflake) diff --git a/interactions/client/models/utils.py b/interactions/client/models/utils.py index 6cde888b0..3422865a2 100644 --- a/interactions/client/models/utils.py +++ b/interactions/client/models/utils.py @@ -31,11 +31,11 @@ async def command(ctx): await asyncio.sleep(5) await ctx.send("I'm awake now!") - :param delay: The amount of time in seconds to wait before defering the command. Defaults to ``2`` seconds. + :param delay?: The amount of time in seconds to wait before defering the command. Defaults to ``2`` seconds. :type delay: Union[float, int] - :param ephemeral: Whether the command is deferred ephemerally. Defaults to ``False``. + :param ephemeral?: Whether the command is deferred ephemerally. Defaults to ``False``. :type ephemeral: bool - :param edit_origin: Whether the command is deferred on origin. Defaults to ``False``. + :param edit_origin?: Whether the command is deferred on origin. Defaults to ``False``. :type edit_origin: bool :return: The inner function, for decorating. :rtype: @@ -101,7 +101,7 @@ async def command(ctx): :param \*components: The components to spread. :type \*components: Union[ActionRow, Button, SelectMenu] - :param max_in_row: The maximum number of components in a single row. Defaults to ``5``. + :param max_in_row?: The maximum number of components in a single row. Defaults to ``5``. :type max_in_row: int """ if not components or len(components) > 25: diff --git a/interactions/ext/base.py b/interactions/ext/base.py index b38235c40..1a98b32af 100644 --- a/interactions/ext/base.py +++ b/interactions/ext/base.py @@ -55,13 +55,13 @@ def __init__( :type link: str :param description: The description of the library, e.g. the purpose. :type description: str - :param long_description: The full description of the library, e.g. README. Defaults to ``None``. + :param long_description?: The full description of the library, e.g. README. Defaults to ``None``. :type long_description: Optional[str] - :param packages: The package(s) of the library. Defaults to ``None``. + :param packages?: The package(s) of the library. Defaults to ``None``. :type packages: Optional[List[str]] - :param requirements: The required modules needed for library function. Defaults to ``None``. + :param requirements?: The required modules needed for library function. Defaults to ``None``. :type requirements: Optional[List[str]] - :param kwargs: Any other keyword arguments. Defaults to ``None``. + :param kwargs?: Any other keyword arguments. Defaults to ``None``. :type kwargs: Optional[dict] """ self.version: Version = version diff --git a/interactions/ext/version.py b/interactions/ext/version.py index 6407f3e39..2269bb57b 100644 --- a/interactions/ext/version.py +++ b/interactions/ext/version.py @@ -43,11 +43,11 @@ def __init__( """ :param name: The name of the author. :type name: str - :param shared: The author's relationship as the main or co-author. Defaults to ``False``. + :param shared?: The author's relationship as the main or co-author. Defaults to ``False``. :type shared: Optional[bool] - :param active: The author's state of activity. Defaults to ``True``. + :param active?: The author's state of activity. Defaults to ``True``. :type active: Optional[bool] - :param email: The author's email address or point of contact. Defaults to ``None``. + :param email?: The author's email address or point of contact. Defaults to ``None``. :type email: Optional[str] """ self.name = name @@ -93,13 +93,13 @@ class Version: def __init__(self, **kwargs) -> None: """ - :param major: The major version. If not specified, ``version`` will be read from. + :param major?: The major version. If not specified, ``version`` will be read from. :type major: Optional[Union[str, int]] - :param minor: The minor version. If not specified, ``version`` will be read from. + :param minor?: The minor version. If not specified, ``version`` will be read from. :type minor: Optional[Union[str, int]] - :param patch: The patch version. If not specified, ``version`` will be read from. + :param patch?: The patch version. If not specified, ``version`` will be read from. :type patch: Optional[Union[str, int]] - :param version: The overall version. Must be used if ``major``, ``minor`` or ``patch`` are not. + :param version?: The overall version. Must be used if ``major``, ``minor`` or ``patch`` are not. :type version: Optional[str] """ self._major = int(kwargs.get("major") or kwargs.get("version", "0.0.0").split(".")[0]) From bfe76ddbc65b137d171b64f30b6f4adf8214c18e Mon Sep 17 00:00:00 2001 From: Toricane Date: Sun, 17 Jul 2022 13:16:49 -0700 Subject: [PATCH 5/5] docs: add ? to optional parameter types --- interactions/api/dispatch.py | 2 +- interactions/api/gateway/client.py | 12 +- interactions/api/http/request.py | 2 +- interactions/api/http/route.py | 2 +- interactions/api/models/channel.py | 94 ++++++------ interactions/api/models/guild.py | 206 +++++++++++++------------- interactions/api/models/gw.py | 36 ++--- interactions/api/models/member.py | 38 ++--- interactions/api/models/message.py | 38 ++--- interactions/api/models/role.py | 18 +-- interactions/api/models/webhook.py | 2 +- interactions/client/bot.py | 66 ++++----- interactions/client/context.py | 20 +-- interactions/client/models/command.py | 24 +-- interactions/client/models/utils.py | 8 +- interactions/ext/base.py | 8 +- interactions/ext/version.py | 14 +- 17 files changed, 295 insertions(+), 295 deletions(-) diff --git a/interactions/api/dispatch.py b/interactions/api/dispatch.py index 4183e1ed6..c35197d46 100644 --- a/interactions/api/dispatch.py +++ b/interactions/api/dispatch.py @@ -58,7 +58,7 @@ def register(self, coro: Callable[..., Coroutine], name: Optional[str] = None) - :param coro: The coroutine to register as an event. :type coro: Callable[..., Coroutine] :param name?: The name to associate the coroutine with. Defaults to None. - :type name: Optional[str] + :type name?: Optional[str] """ _name: str = coro.__name__ if name is None else name event = self.events.get(_name, []) diff --git a/interactions/api/gateway/client.py b/interactions/api/gateway/client.py index ce9640da6..546236829 100644 --- a/interactions/api/gateway/client.py +++ b/interactions/api/gateway/client.py @@ -103,9 +103,9 @@ def __init__( :param intents: The Gateway intents of the application for event dispatch. :type intents: Intents :param session_id?: The ID of the session if trying to reconnect. Defaults to ``None``. - :type session_id: Optional[str] + :type session_id?: Optional[str] :param sequence?: The identifier sequence if trying to reconnect. Defaults to ``None``. - :type sequence: Optional[int] + :type sequence?: Optional[int] """ try: self._loop = get_event_loop() if version_info < (3, 10) else get_running_loop() @@ -169,7 +169,7 @@ async def _establish_connection( Establishes a client connection with the Gateway. :param shard?: The shards to establish a connection with. Defaults to ``None``. - :type shard: Optional[List[Tuple[int]]] + :type shard?: Optional[List[Tuple[int]]] :param presence: The presence to carry with. Defaults to ``None``. :type presence: Optional[ClientPresence] """ @@ -211,7 +211,7 @@ async def _handle_connection( :param stream: The packet stream to handle. :type stream: Dict[str, Any] :param shard?: The shards to establish a connection with. Defaults to ``None``. - :type shard: Optional[List[Tuple[int]]] + :type shard?: Optional[List[Tuple[int]]] :param presence: The presence to carry with. Defaults to ``None``. :type presence: Optional[ClientPresence] """ @@ -662,9 +662,9 @@ async def __identify( Sends an ``IDENTIFY`` packet to the gateway. :param shard?: The shard ID to identify under. - :type shard: Optional[List[Tuple[int]]] + :type shard?: Optional[List[Tuple[int]]] :param presence?: The presence to change the bot to on identify. - :type presence: Optional[ClientPresence] + :type presence?: Optional[ClientPresence] """ self.__shard = shard self.__presence = presence diff --git a/interactions/api/http/request.py b/interactions/api/http/request.py index 96d9d6779..e27694cc1 100644 --- a/interactions/api/http/request.py +++ b/interactions/api/http/request.py @@ -93,7 +93,7 @@ async def request(self, route: Route, **kwargs) -> Optional[Any]: :param route: The HTTP route to request. :type route: Route :param \**kwargs?: Optional keyword-only arguments to pass as information in the request. - :type \**kwargs: dict + :type \**kwargs?: dict :return: The contents of the request if any. :rtype: Optional[Any] """ diff --git a/interactions/api/http/route.py b/interactions/api/http/route.py index cf20a2455..7b2019f9c 100644 --- a/interactions/api/http/route.py +++ b/interactions/api/http/route.py @@ -28,7 +28,7 @@ def __init__(self, method: str, path: str, **kwargs) -> None: :param path: The path of the HTTP/URL. :type path: str :param \**kwargs?: Optional keyword-only arguments to pass as information in the route. - :type \**kwargs: dict + :type \**kwargs?: dict """ self.method = method self.path = path.format(**kwargs) diff --git a/interactions/api/models/channel.py b/interactions/api/models/channel.py index d0cb36d5d..594b2665d 100644 --- a/interactions/api/models/channel.py +++ b/interactions/api/models/channel.py @@ -211,21 +211,21 @@ async def send( Sends a message in the channel. :param content?: The contents of the message as a string or string-converted value. - :type content: Optional[str] + :type content?: Optional[str] :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. - :type tts: Optional[bool] + :type tts?: Optional[bool] :param files?: A file or list of files to be attached to the message. - :type files: Optional[Union[File, List[File]]] + :type files?: Optional[Union[File, List[File]]] :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first - :type attachments: Optional[List[Attachment]] + :type attachments?: Optional[List[Attachment]] :param embeds?: An embed, or list of embeds for the message. - :type embeds: Optional[Union[Embed, List[Embed]]] + :type embeds?: Optional[Union[Embed, List[Embed]]] :param allowed_mentions?: The message interactions/mention limits that the message can refer to. - :type allowed_mentions: Optional[MessageInteraction] + :type allowed_mentions?: Optional[MessageInteraction] :param stickers?: A list of stickers to send with your message. You can send up to 3 stickers per message. - :type stickers: Optional[List[Sticker]] + :type stickers?: Optional[List[Sticker]] :param components?: A component, or list of components for the message. - :type components: Optional[Union[ActionRow, Button, SelectMenu, List[Actionrow], List[Button], List[SelectMenu]]] + :type components?: Optional[Union[ActionRow, Button, SelectMenu, List[Actionrow], List[Button], List[SelectMenu]]] :return: The sent message as an object. :rtype: Message """ @@ -315,31 +315,31 @@ async def modify( The fields `archived`, `auto_archive_duration` and `locked` require the provided channel to be a thread. :param name?: The name of the channel, defaults to the current value of the channel - :type name: str + :type name?: str :param topic?: The topic of that channel, defaults to the current value of the channel - :type topic: Optional[str] + :type topic?: Optional[str] :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel - :type bitrate: Optional[int] + :type bitrate?: Optional[int] :param user_limit?: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel - :type user_limit: Optional[int] + :type user_limit?: Optional[int] :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel :type rate_limit_per_user: Optional[int] :param position?: Sorting position of the channel, defaults to the current value of the channel - :type position: Optional[int] + :type position?: Optional[int] :param parent_id?: The id of the parent category for a channel, defaults to the current value of the channel - :type parent_id: Optional[int] + :type parent_id?: Optional[int] :param nsfw?: Whether the channel is nsfw or not, defaults to the current value of the channel - :type nsfw: Optional[bool] + :type nsfw?: Optional[bool] :param permission_overwrites?: The permission overwrites, if any - :type permission_overwrites: Optional[List[Overwrite]] + :type permission_overwrites?: Optional[List[Overwrite]] :param archived?: Whether the thread is archived - :type archived: Optional[bool] + :type archived?: Optional[bool] :param auto_archive_duration?: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 - :type auto_archive_duration: Optional[int] + :type auto_archive_duration?: Optional[int] :param locked?: Whether the thread is locked - :type locked: Optional[bool] + :type locked?: Optional[bool] :param reason?: The reason for the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The modified channel as new object :rtype: Channel """ @@ -415,7 +415,7 @@ async def set_name( :param name: The new name of the channel :type name: str :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -434,7 +434,7 @@ async def set_topic( :param topic: The new topic of the channel :type topic: str :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -453,7 +453,7 @@ async def set_bitrate( :param bitrate: The new bitrate of the channel :type bitrate: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -475,7 +475,7 @@ async def set_user_limit( :param user_limit: The new user limit of the channel :type user_limit: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -499,7 +499,7 @@ async def set_rate_limit_per_user( :param rate_limit_per_user: The new rate_limit_per_user of the channel (0-21600) :type rate_limit_per_user: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -518,7 +518,7 @@ async def set_position( :param position: The new position of the channel :type position: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -537,7 +537,7 @@ async def set_parent_id( :param parent_id: The new parent_id of the channel :type parent_id: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -556,7 +556,7 @@ async def set_nsfw( :param nsfw: The new nsfw-flag of the channel :type nsfw: bool :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -575,7 +575,7 @@ async def archive( :param archived: Whether the Thread is archived, defaults to True :type archived: bool :param reason?: The reason of the archiving - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -594,7 +594,7 @@ async def set_auto_archive_duration( :param auto_archive_duration: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 :type auto_archive_duration: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -613,7 +613,7 @@ async def lock( :param locked: Whether the Thread is locked, defaults to True :type locked: bool :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] :return: The edited channel :rtype: Channel """ @@ -779,13 +779,13 @@ def check_pinned(message): :param amount: The amount of messages to delete :type amount: int :param check?: The function used to check if a message should be deleted. The message is only deleted if the check returns `True` - :type check: Callable[[Message], bool] + :type check?: Callable[[Message], bool] :param before?: An id of a message to purge only messages before that message - :type before: Optional[int] + :type before?: Optional[int] :param bulk?: Whether to bulk delete the messages (you cannot delete messages older than 14 days, default) or to delete every message seperately :param bulk: Optional[bool] :param reason?: The reason of the deletes - :type reason: Optional[str] + :type reason?: Optional[str] :return: A list of the deleted messages :rtype: List[Message] """ @@ -975,15 +975,15 @@ async def create_thread( :type name: str :param auto_archive_duration?: duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 - :type auto_archive_duration: Optional[int] + :type auto_archive_duration?: Optional[int] :param type?: The type of thread, defaults to public. ignored if creating thread from a message - :type type: Optional[ChannelType] + :type type?: Optional[ChannelType] :param invitable?: Boolean to display if the Thread is open to join or private. - :type invitable: Optional[bool] + :type invitable?: Optional[bool] :param message_id?: An optional message to create a thread from. - :type message_id: Optional[Union[int, Snowflake, "Message"]] + :type message_id?: Optional[Union[int, Snowflake, "Message"]] :param reason?: An optional reason for the audit log - :type reason: Optional[str] + :type reason?: Optional[str] :return: The created thread :rtype: Channel """ @@ -1037,21 +1037,21 @@ async def create_invite( Creates an invite for the channel :param max_age?: Duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days). Default 86400 (24h) - :type max_age: Optional[int] + :type max_age?: Optional[int] :param max_uses?: Max number of uses or 0 for unlimited. between 0 and 100. Default 0 - :type max_uses: Optional[int] + :type max_uses?: Optional[int] :param temporary?: Whether this invite only grants temporary membership. Default False - :type temporary: Optional[bool] + :type temporary?: Optional[bool] :param unique?: If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). Default False - :type unique: Optional[bool] + :type unique?: Optional[bool] :param target_type?: The type of target for this voice channel invite - :type target_type: Optional["InviteTargetType"] + :type target_type?: Optional["InviteTargetType"] :param target_user_id?: The id of the user whose stream to display for this invite, required if target_type is STREAM, the user must be streaming in the channel - :type target_user_id: Optional[int] + :type target_user_id?: Optional[int] :param target_application_id?: The id of the embedded application to open for this invite, required if target_type is EMBEDDED_APPLICATION, the application must have the EMBEDDED flag - :type target_application_id: Optional[int] + :type target_application_id?: Optional[int] :param reason?: The reason for the creation of the invite - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: diff --git a/interactions/api/models/guild.py b/interactions/api/models/guild.py index 20964d430..1fb23b788 100644 --- a/interactions/api/models/guild.py +++ b/interactions/api/models/guild.py @@ -374,9 +374,9 @@ async def ban( :param member_id: The id of the member to ban :type member_id: Union[int, Member, Snowflake] :param reason?: The reason of the ban - :type reason: Optional[str] + :type reason?: Optional[str] :param delete_message_days?: Number of days to delete messages, from 0 to 7. Defaults to 0 - :type delete_message_days: Optional[int] + :type delete_message_days?: Optional[int] """ if not self._client: raise LibraryException(code=13) @@ -406,7 +406,7 @@ async def remove_ban( :param user_id: The id of the user to remove the ban from :type user_id: Union[int, Snowflake] :param reason?: The reason for the removal of the ban - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -427,7 +427,7 @@ async def kick( :param member_id: The id of the member to kick :type member_id: Union[int, Member, Snowflake] :param reason?: The reason for the kick - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -456,7 +456,7 @@ async def add_member_role( :param member_id: The id of the member to add the roles to :type member_id: Union[Member, int, Snowflake] :param reason?: The reason why the roles are added - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -485,7 +485,7 @@ async def remove_member_role( :param member_id: The id of the member to remove the roles from :type member_id: Union[Member, int, Snowflake] :param reason?: The reason why the roles are removed - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -517,19 +517,19 @@ async def create_role( :param name: The name of the role :type name: str :param color?: RGB color value as integer, default ``0`` - :type color: Optional[int] + :type color?: Optional[int] :param permissions?: Bitwise value of the enabled/disabled permissions - :type permissions: Optional[int] + :type permissions?: Optional[int] :param hoist?: Whether the role should be displayed separately in the sidebar, default ``False`` - :type hoist: Optional[bool] + :type hoist?: Optional[bool] :param icon?: The role's icon image (if the guild has the ROLE_ICONS feature) - :type icon: Optional[Image] + :type icon?: Optional[Image] :param unicode_emoji?: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature) - :type unicode_emoji: Optional[str] + :type unicode_emoji?: Optional[str] :param mentionable?: Whether the role should be mentionable, default ``False`` - :type mentionable: Optional[bool] + :type mentionable?: Optional[bool] :param reason?: The reason why the role is created, default ``None`` - :type reason: Optional[str] + :type reason?: Optional[str] :return: The created Role :rtype: Role """ @@ -620,7 +620,7 @@ async def delete_role( :param role_id: The id of the role to delete :type role_id: Union[int, Snowflake, Role] :param reason?: The reason of the deletion - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -657,21 +657,21 @@ async def modify_role( :param role_id: The id of the role to edit :type role_id: Union[int, Snowflake, Role] :param name?: The name of the role, defaults to the current value of the role - :type name: Optional[str] + :type name?: Optional[str] :param color?: RGB color value as integer, defaults to the current value of the role - :type color: Optional[int] + :type color?: Optional[int] :param permissions?: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role - :type permissions: Optional[int] + :type permissions?: Optional[int] :param hoist?: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role - :type hoist: Optional[bool] + :type hoist?: Optional[bool] :param icon?: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role - :type icon: Optional[Image] + :type icon?: Optional[Image] :param unicode_emoji?: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role - :type unicode_emoji: Optional[str] + :type unicode_emoji?: Optional[str] :param mentionable?: Whether the role should be mentionable, defaults to the current value of the role - :type mentionable: Optional[bool] + :type mentionable?: Optional[bool] :param reason?: The reason why the role is edited, default ``None`` - :type reason: Optional[str] + :type reason?: Optional[str] :return: The modified role object :rtype: Role """ @@ -737,15 +737,15 @@ async def create_thread( :type channel_id: Union[int, Snowflake, Channel] :param auto_archive_duration?: duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 - :type auto_archive_duration: Optional[int] + :type auto_archive_duration?: Optional[int] :param type?: The type of thread, defaults to public. ignored if creating thread from a message - :type type: Optional[ChannelType] + :type type?: Optional[ChannelType] :param invitable?: Boolean to display if the Thread is open to join or private. - :type invitable: Optional[bool] + :type invitable?: Optional[bool] :param message_id?: An optional message to create a thread from. - :type message_id: Optional[Union[int, Snowflake, "Message"]] + :type message_id?: Optional[Union[int, Snowflake, "Message"]] :param reason?: An optional reason for the audit log - :type reason: Optional[str] + :type reason?: Optional[str] :return: The created thread :rtype: Channel """ @@ -802,21 +802,21 @@ async def create_channel( :param type: The type of the channel :type type: ChannelType :param topic?: The topic of that channel - :type topic: Optional[str] + :type topic?: Optional[str] :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel - :type bitrate: Optional[int] + :type bitrate?: Optional[int] :param user_limit?: (voice channel only) Maximum amount of users in the channel - :type user_limit: Optional[int] + :type user_limit?: Optional[int] :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600) :type rate_limit_per_user: Optional[int] :param position?: Sorting position of the channel - :type position: Optional[int] + :type position?: Optional[int] :param parent_id?: The id of the parent category for a channel - :type parent_id: Optional[Union[int, Channel, Snowflake]] + :type parent_id?: Optional[Union[int, Channel, Snowflake]] :param permission_overwrites?: The permission overwrites, if any - :type permission_overwrites: Optional[Overwrite] + :type permission_overwrites?: Optional[Overwrite] :param nsfw?: Whether the channel is nsfw or not, default ``False`` - :type nsfw: Optional[bool] + :type nsfw?: Optional[bool] :param reason: The reason for the creation :type reason: Optional[str] :return: The created channel @@ -929,29 +929,29 @@ async def modify_channel( :param channel_id: The id of the channel to modify :type channel_id: Union[int, Snowflake, Channel] :param name?: The name of the channel, defaults to the current value of the channel - :type name: str + :type name?: str :param topic?: The topic of that channel, defaults to the current value of the channel - :type topic: Optional[str] + :type topic?: Optional[str] :param bitrate?: (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel - :type bitrate: Optional[int] + :type bitrate?: Optional[int] :param user_limit?: (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel - :type user_limit: Optional[int] + :type user_limit?: Optional[int] :param rate_limit_per_use?: Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel :type rate_limit_per_user: Optional[int] :param position?: Sorting position of the channel, defaults to the current value of the channel - :type position: Optional[int] + :type position?: Optional[int] :param parent_id?: The id of the parent category for a channel, defaults to the current value of the channel - :type parent_id: Optional[int] + :type parent_id?: Optional[int] :param permission_overwrites?: The permission overwrites, if any - :type permission_overwrites: Optional[Overwrite] + :type permission_overwrites?: Optional[Overwrite] :param nsfw?: Whether the channel is nsfw or not, defaults to the current value of the channel - :type nsfw: Optional[bool] + :type nsfw?: Optional[bool] :param archived?: Whether the thread is archived - :type archived: Optional[bool] + :type archived?: Optional[bool] :param auto_archive_duration?: The time after the thread is automatically archived. One of 60, 1440, 4320, 10080 - :type auto_archive_duration: Optional[int] + :type auto_archive_duration?: Optional[int] :param locked?: Whether the thread is locked - :type locked: Optional[bool] + :type locked?: Optional[bool] :param reason: The reason for the edit :type reason: Optional[str] :return: The modified channel @@ -1050,19 +1050,19 @@ async def modify_member( :param member_id: The id of the member to modify :type member_id: Union[int, Snowflake, Member] :param nick?: The nickname of the member - :type nick: Optional[str] + :type nick?: Optional[str] :param roles?: A list of all role ids the member has - :type roles: Optional[List[int]] + :type roles?: Optional[List[int]] :param mute?: whether the user is muted in voice channels - :type mute: Optional[bool] + :type mute?: Optional[bool] :param deaf?: whether the user is deafened in voice channels - :type deaf: Optional[bool] + :type deaf?: Optional[bool] :param channel_id?: id of channel to move user to (if they are connected to voice) - :type channel_id: Optional[int] + :type channel_id?: Optional[int] :param communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) - :type communication_disabled_until: Optional[datetime.isoformat] + :type communication_disabled_until?: Optional[datetime.isoformat] :param reason?: The reason of the modifying - :type reason: Optional[str] + :type reason?: Optional[str] :return: The modified member :rtype: Member """ @@ -1157,49 +1157,49 @@ async def modify( Modifies the current guild. :param name?: The new name of the guild - :type name: Optional[str] + :type name?: Optional[str] :param verification_level?: The verification level of the guild - :type verification_level: Optional[VerificationLevel] + :type verification_level?: Optional[VerificationLevel] :param default_message_notifications?: The default message notification level for members - :type default_message_notifications: Optional[DefaultMessageNotificationLevel] + :type default_message_notifications?: Optional[DefaultMessageNotificationLevel] :param explicit_content_filter?: The explicit content filter level for media content - :type explicit_content_filter: Optional[ExplicitContentFilterLevel] + :type explicit_content_filter?: Optional[ExplicitContentFilterLevel] :param afk_channel_id?: The id for the afk voice channel - :type afk_channel_id: Optional[int] + :type afk_channel_id?: Optional[int] :param afk_timeout?: Afk timeout in seconds - :type afk_timeout: Optional[int] + :type afk_timeout?: Optional[int] :param icon?: 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature) - :type icon: Optional[Image] + :type icon?: Optional[Image] :param owner_id?: The id of the user to transfer the guild ownership to. You must be the owner to perform this - :type owner_id: Optional[int] + :type owner_id?: Optional[int] :param splash?: 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature) - :type splash: Optional[Image] + :type splash?: Optional[Image] :param discovery_splash?: 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature) - :type discovery_splash: Optional[Image] + :type discovery_splash?: Optional[Image] :param banner?: 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature; can be animated gif when the server has the ANIMATED_BANNER feature) - :type banner: Optional[Image] + :type banner?: Optional[Image] :param system_channel_id?: The id of the channel where guild notices such as welcome messages and boost events are posted - :type system_channel_id: Optional[int] + :type system_channel_id?: Optional[int] :param suppress_join_notifications?: Whether to suppress member join notifications in the system channel or not - :type suppress_join_notifications: Optional[bool] + :type suppress_join_notifications?: Optional[bool] :param suppress_premium_subscriptions?: Whether to suppress server boost notifications in the system channel or not - :type suppress_premium_subscriptions: Optional[bool] + :type suppress_premium_subscriptions?: Optional[bool] :param suppress_guild_reminder_notifications?: Whether to suppress server setup tips in the system channel or not - :type suppress_guild_reminder_notifications: Optional[bool] + :type suppress_guild_reminder_notifications?: Optional[bool] :param suppress_join_notification_replies?: Whether to hide member join sticker reply buttons in the system channel or not - :type suppress_join_notification_replies: Optional[bool] + :type suppress_join_notification_replies?: Optional[bool] :param rules_channel_id?: The id of the channel where guilds display rules and/or guidelines - :type rules_channel_id: Optional[int] + :type rules_channel_id?: Optional[int] :param public_updates_channel_id?: The id of the channel where admins and moderators of community guilds receive notices from Discord - :type public_updates_channel_id: Optional[int] + :type public_updates_channel_id?: Optional[int] :param preferred_locale?: The preferred locale of a community guild used in server discovery and notices from Discord; defaults to "en-US" - :type preferred_locale: Optional[str] + :type preferred_locale?: Optional[str] :param description?: The description for the guild, if the guild is discoverable - :type description: Optional[str] + :type description?: Optional[str] :param premium_progress_bar_enabled?: Whether the guild's boost progress bar is enabled - :type premium_progress_bar_enabled: Optional[bool] + :type premium_progress_bar_enabled?: Optional[bool] :param reason?: The reason for the modifying - :type reason: Optional[str] + :type reason?: Optional[str] :return: The modified guild :rtype: Guild """ @@ -1294,7 +1294,7 @@ async def set_name( :param name: The new name of the guild :type name: str :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(name=name, reason=reason) @@ -1310,7 +1310,7 @@ async def set_verification_level( :param verification_level: The new verification level of the guild :type verification_level: VerificationLevel :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(verification_level=verification_level, reason=reason) @@ -1326,7 +1326,7 @@ async def set_default_message_notifications( :param default_message_notifications: The new default message notification level of the guild :type default_message_notifications: DefaultMessageNotificationLevel :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify( default_message_notifications=default_message_notifications, reason=reason @@ -1344,7 +1344,7 @@ async def set_explicit_content_filter( :param explicit_content_filter: The new explicit content filter level of the guild :type explicit_content_filter: ExplicitContentFilterLevel :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(explicit_content_filter=explicit_content_filter, reason=reason) @@ -1360,7 +1360,7 @@ async def set_afk_channel( :param afk_channel_id: The new name of the guild :type afk_channel_id: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(afk_channel_id=afk_channel_id, reason=reason) @@ -1376,7 +1376,7 @@ async def set_afk_timeout( :param afk_timeout: The new afk timeout of the guild :type afk_timeout: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(afk_timeout=afk_timeout, reason=reason) @@ -1392,7 +1392,7 @@ async def set_system_channel( :param system_channel_id: The new system channel id of the guild :type system_channel_id: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(system_channel_id=system_channel_id, reason=reason) @@ -1408,7 +1408,7 @@ async def set_rules_channel( :param rules_channel_id: The new rules channel id of the guild :type rules_channel_id: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(rules_channel_id=rules_channel_id, reason=reason) @@ -1424,7 +1424,7 @@ async def set_public_updates_channel( :param public_updates_channel_id: The new public updates channel id of the guild :type public_updates_channel_id: int :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(public_updates_channel_id=public_updates_channel_id, reason=reason) @@ -1440,7 +1440,7 @@ async def set_preferred_locale( :param preferred_locale: The new preferredlocale of the guild :type preferred_locale: str :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(preferred_locale=preferred_locale, reason=reason) @@ -1456,7 +1456,7 @@ async def set_description( :param description: The new description of the guild :type description: str :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(description=description, reason=reason) @@ -1472,7 +1472,7 @@ async def set_premium_progress_bar_enabled( :param premium_progress_bar_enabled: Whether the bar is enabled or not :type premium_progress_bar_enabled: bool :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify( premium_progress_bar_enabled=premium_progress_bar_enabled, reason=reason @@ -1490,7 +1490,7 @@ async def set_icon( :param icon: The new icon of the guild :type icon: Image :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(icon=icon, reason=reason) @@ -1506,7 +1506,7 @@ async def set_splash( :param splash: The new splash of the guild :type splash: Image :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(splash=splash, reason=reason) @@ -1522,7 +1522,7 @@ async def set_discovery_splash( :param discovery_splash: The new discovery_splash of the guild :type discovery_splash: Image :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(discovery_splash=discovery_splash, reason=reason) @@ -1538,7 +1538,7 @@ async def set_banner( :param banner: The new banner of the guild :type banner: Image :param reason?: The reason of the edit - :type reason: Optional[str] + :type reason?: Optional[str] """ return await self.modify(banner=banner, reason=reason) @@ -1564,13 +1564,13 @@ async def create_scheduled_event( :param scheduled_start_time: The time to schedule the scheduled event :type scheduled_start_time: datetime.isoformat :param scheduled_end_time?: The time when the scheduled event is scheduled to end - :type scheduled_end_time: Optional[datetime.isoformat] + :type scheduled_end_time?: Optional[datetime.isoformat] :param entity_metadata?: The entity metadata of the scheduled event - :type entity_metadata: Optional[EventMetadata] + :type entity_metadata?: Optional[EventMetadata] :param channel_id?: The channel id of the scheduled event. - :type channel_id: Optional[int] + :type channel_id?: Optional[int] :param description?: The description of the scheduled event - :type description: Optional[str] + :type description?: Optional[str] :param image?: The cover image of the scheduled event :type image?: Optional[Image] :return: The created event @@ -1639,15 +1639,15 @@ async def modify_scheduled_event( :param scheduled_start_time: The time to schedule the scheduled event :type scheduled_start_time: Optional[datetime.isoformat] :param scheduled_end_time?: The time when the scheduled event is scheduled to end - :type scheduled_end_time: Optional[datetime.isoformat] + :type scheduled_end_time?: Optional[datetime.isoformat] :param entity_metadata?: The entity metadata of the scheduled event - :type entity_metadata: Optional[EventMetadata] + :type entity_metadata?: Optional[EventMetadata] :param channel_id?: The channel id of the scheduled event. - :type channel_id: Optional[int] + :type channel_id?: Optional[int] :param description?: The description of the scheduled event - :type description: Optional[str] + :type description?: Optional[str] :param status?: The status of the scheduled event - :type status: Optional[EventStatus] + :type status?: Optional[EventStatus] :param image?: The cover image of the scheduled event :type image?: Optional[Image] :return: The modified event @@ -1796,7 +1796,7 @@ async def modify_role_position( :param position: The new position of the role :type position: int :param reason?: The reason for the modifying - :type reason: Optional[str] + :type reason?: Optional[str] :return: List of guild roles with updated hierarchy :rtype: List[Role] """ @@ -2021,9 +2021,9 @@ async def get_list_of_members( Lists the members of a guild. :param limit?: How many members to get from the API. Max is 1000. - :type limit: Optional[int] + :type limit?: Optional[int] :param after?: Get only Members after this member. - :type after: Optional[Union[Member, int]] + :type after?: Optional[Union[Member, int]] :return: A list of members :rtype: List[Member] """ @@ -2051,7 +2051,7 @@ async def search_members(self, query: str, limit: Optional[int] = 1) -> List[Mem :param query: The string to search for :type query: str :param limit?: The number of members to return. - :type limit: Optional[int] + :type limit?: Optional[int] :return: A list of matching members :rtype: List[Member] """ diff --git a/interactions/api/models/gw.py b/interactions/api/models/gw.py index b11966690..1fd5f956d 100644 --- a/interactions/api/models/gw.py +++ b/interactions/api/models/gw.py @@ -305,9 +305,9 @@ async def ban( Bans the member from a guild. :param reason?: The reason of the ban - :type reason: Optional[str] + :type reason?: Optional[str] :param delete_message_days?: Number of days to delete messages, from 0 to 7. Defaults to 0 - :type delete_message_days: Optional[int] + :type delete_message_days?: Optional[int] """ await self._client.create_guild_ban( guild_id=int(self.guild_id), @@ -324,7 +324,7 @@ async def kick( Kicks the member from a guild. :param reason?: The reason for the kick - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -345,7 +345,7 @@ async def add_role( :param role: The role to add. Either ``Role`` object or role_id :type role: Union[Role, int] :param reason?: The reason why the roles are added - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -375,7 +375,7 @@ async def remove_role( :param role: The role to remove. Either ``Role`` object or role_id :type role: Union[Role, int] :param reason?: The reason why the roles are removed - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -417,17 +417,17 @@ async def send( Sends a DM to the member. :param content?: The contents of the message as a string or string-converted value. - :type content: Optional[str] + :type content?: Optional[str] :param components?: A component, or list of components for the message. - :type components: Optional[Union[ActionRow, Button, SelectMenu, List[Actionrow], List[Button], List[SelectMenu]]] + :type components?: Optional[Union[ActionRow, Button, SelectMenu, List[Actionrow], List[Button], List[SelectMenu]]] :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. - :type tts: Optional[bool] + :type tts?: Optional[bool] :param files?: A file or list of files to be attached to the message. - :type files: Optional[Union[File, List[File]]] + :type files?: Optional[Union[File, List[File]]] :param embeds?: An embed, or list of embeds for the message. - :type embeds: Optional[Union[Embed, List[Embed]]] + :type embeds?: Optional[Union[Embed, List[Embed]]] :param allowed_mentions?: The message interactions/mention limits that the message can refer to. - :type allowed_mentions: Optional[MessageInteraction] + :type allowed_mentions?: Optional[MessageInteraction] :return: The sent message as an object. :rtype: Message """ @@ -489,19 +489,19 @@ async def modify( Modifies the member of a guild. :param nick?: The nickname of the member - :type nick: Optional[str] + :type nick?: Optional[str] :param roles?: A list of all role ids the member has - :type roles: Optional[List[int]] + :type roles?: Optional[List[int]] :param mute?: whether the user is muted in voice channels - :type mute: Optional[bool] + :type mute?: Optional[bool] :param deaf?: whether the user is deafened in voice channels - :type deaf: Optional[bool] + :type deaf?: Optional[bool] :param channel_id?: id of channel to move user to (if they are connected to voice) - :type channel_id: Optional[int] + :type channel_id?: Optional[int] :param communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) - :type communication_disabled_until: Optional[datetime.isoformat] + :type communication_disabled_until?: Optional[datetime.isoformat] :param reason?: The reason of the modifying - :type reason: Optional[str] + :type reason?: Optional[str] :return: The modified member object :rtype: Member """ diff --git a/interactions/api/models/member.py b/interactions/api/models/member.py index d585dacf4..fc23af51c 100644 --- a/interactions/api/models/member.py +++ b/interactions/api/models/member.py @@ -108,9 +108,9 @@ async def ban( :param guild_id: The id of the guild to ban the member from :type guild_id: Union[int, Snowflake, "Guild"] :param reason?: The reason of the ban - :type reason: Optional[str] + :type reason?: Optional[str] :param delete_message_days?: Number of days to delete messages, from 0 to 7. Defaults to 0 - :type delete_message_days: Optional[int] + :type delete_message_days?: Optional[int] """ _guild_id = int(guild_id) if isinstance(guild_id, (Snowflake, int)) else int(guild_id.id) @@ -133,7 +133,7 @@ async def kick( :param guild_id: The id of the guild to kick the member from :type guild_id: Union[int, Snowflake, "Guild"] :param reason?: The reason for the kick - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -160,7 +160,7 @@ async def add_role( :param guild_id: The id of the guild to add the roles to the member :type guild_id: Union[int, Snowflake, "Guild"] :param reason?: The reason why the roles are added - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -189,7 +189,7 @@ async def remove_role( :param guild_id: The id of the guild to remove the roles of the member :type guild_id: Union[int, Snowflake, "Guild"] :param reason?: The reason why the roles are removed - :type reason: Optional[str] + :type reason?: Optional[str] """ if not self._client: raise LibraryException(code=13) @@ -228,19 +228,19 @@ async def send( Sends a DM to the member. :param content?: The contents of the message as a string or string-converted value. - :type content: Optional[str] + :type content?: Optional[str] :param components?: A component, or list of components for the message. - :type components: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] + :type components?: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. - :type tts: Optional[bool] + :type tts?: Optional[bool] :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first - :type attachments: Optional[List[Attachment]] + :type attachments?: Optional[List[Attachment]] :param files?: A file or list of files to be attached to the message. - :type files: Optional[Union[File, List[File]]] + :type files?: Optional[Union[File, List[File]]] :param embeds?: An embed, or list of embeds for the message. - :type embeds: Optional[Union[Embed, List[Embed]]] + :type embeds?: Optional[Union[Embed, List[Embed]]] :param allowed_mentions?: The message interactions/mention limits that the message can refer to. - :type allowed_mentions: Optional[MessageInteraction] + :type allowed_mentions?: Optional[MessageInteraction] :return: The sent message as an object. :rtype: Message """ @@ -305,19 +305,19 @@ async def modify( :param guild_id: The id of the guild to modify the member on :type guild_id: Union[int, Snowflake, "Guild"] :param nick?: The nickname of the member - :type nick: Optional[str] + :type nick?: Optional[str] :param roles?: A list of all role ids the member has - :type roles: Optional[List[int]] + :type roles?: Optional[List[int]] :param mute?: whether the user is muted in voice channels - :type mute: Optional[bool] + :type mute?: Optional[bool] :param deaf?: whether the user is deafened in voice channels - :type deaf: Optional[bool] + :type deaf?: Optional[bool] :param channel_id?: id of channel to move user to (if they are connected to voice) - :type channel_id: Optional[Union[Channel, int, Snowflake]] + :type channel_id?: Optional[Union[Channel, int, Snowflake]] :param communication_disabled_until?: when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future) - :type communication_disabled_until: Optional[datetime.isoformat] + :type communication_disabled_until?: Optional[datetime.isoformat] :param reason?: The reason of the modifying - :type reason: Optional[str] + :type reason?: Optional[str] :return: The modified member object :rtype: Member """ diff --git a/interactions/api/models/message.py b/interactions/api/models/message.py index 4167c1bd0..11dc74949 100644 --- a/interactions/api/models/message.py +++ b/interactions/api/models/message.py @@ -951,21 +951,21 @@ async def edit( This method edits a message. Only available for messages sent by the bot. :param content?: The contents of the message as a string or string-converted value. - :type content: Optional[str] + :type content?: Optional[str] :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. - :type tts: Optional[bool] + :type tts?: Optional[bool] :param files?: A file or list of files to be attached to the message. - :type files: Optional[Union[File, List[File]]] + :type files?: Optional[Union[File, List[File]]] :param embeds?: An embed, or list of embeds for the message. - :type embeds: Optional[Union[Embed, List[Embed]]] + :type embeds?: Optional[Union[Embed, List[Embed]]] :param suppress_embeds?: Whether to suppress embeds in the message. - :type suppress_embeds: Optional[bool] + :type suppress_embeds?: Optional[bool] :param allowed_mentions?: The message interactions/mention limits that the message can refer to. - :type allowed_mentions: Optional[MessageInteraction] + :type allowed_mentions?: Optional[MessageInteraction] :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first - :type attachments: Optional[List[Attachment]] + :type attachments?: Optional[List[Attachment]] :param components?: A component, or list of components for the message. If `[]` the components will be removed - :type components: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] + :type components?: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] :return: The edited message as an object. :rtype: Message """ @@ -1065,21 +1065,21 @@ async def reply( Sends a new message replying to the old. :param content?: The contents of the message as a string or string-converted value. - :type content: Optional[str] + :type content?: Optional[str] :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. - :type tts: Optional[bool] + :type tts?: Optional[bool] :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first - :type attachments: Optional[List[Attachment]] + :type attachments?: Optional[List[Attachment]] :param files?: A file or list of files to be attached to the message. - :type files: Optional[Union[File, List[File]]] + :type files?: Optional[Union[File, List[File]]] :param embeds?: An embed, or list of embeds for the message. - :type embeds: Optional[Union[Embed, List[Embed]]] + :type embeds?: Optional[Union[Embed, List[Embed]]] :param allowed_mentions?: The message interactions/mention limits that the message can refer to. - :type allowed_mentions: Optional[MessageInteraction] + :type allowed_mentions?: Optional[MessageInteraction] :param components?: A component, or list of components for the message. - :type components: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] + :type components?: Optional[Union[ActionRow, Button, SelectMenu, List[ActionRow], List[Button], List[SelectMenu]]] :param stickers?: A list of stickers to send with your message. You can send up to 3 stickers per message. - :type stickers: Optional[List[Sticker]] + :type stickers?: Optional[List[Sticker]] :return: The sent message as an object. :rtype: Message """ @@ -1177,11 +1177,11 @@ async def create_thread( :type name: str :param auto_archive_duration?: duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 - :type auto_archive_duration: Optional[int] + :type auto_archive_duration?: Optional[int] :param invitable?: Boolean to display if the Thread is open to join or private. - :type invitable: Optional[bool] + :type invitable?: Optional[bool] :param reason?: An optional reason for the audit log - :type reason: Optional[str] + :type reason?: Optional[str] :return: The created thread :rtype: Channel """ diff --git a/interactions/api/models/role.py b/interactions/api/models/role.py index 05c49fe3c..b25bb755a 100644 --- a/interactions/api/models/role.py +++ b/interactions/api/models/role.py @@ -110,21 +110,21 @@ async def modify( :param guild_id: The id of the guild to edit the role on :type guild_id: int :param name?: The name of the role, defaults to the current value of the role - :type name: Optional[str] + :type name?: Optional[str] :param color?: RGB color value as integer, defaults to the current value of the role - :type color: Optional[int] + :type color?: Optional[int] :param permissions?: Bitwise value of the enabled/disabled permissions, defaults to the current value of the role - :type permissions: Optional[int] + :type permissions?: Optional[int] :param hoist?: Whether the role should be displayed separately in the sidebar, defaults to the current value of the role - :type hoist: Optional[bool] + :type hoist?: Optional[bool] :param icon?: The role's icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role - :type icon: Optional[Image] + :type icon?: Optional[Image] :param unicode_emoji?: The role's unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role - :type unicode_emoji: Optional[str] + :type unicode_emoji?: Optional[str] :param mentionable?: Whether the role should be mentionable, defaults to the current value of the role - :type mentionable: Optional[bool] + :type mentionable?: Optional[bool] :param reason?: The reason why the role is edited, default ``None`` - :type reason: Optional[str] + :type reason?: Optional[str] :return: The modified role object :rtype: Role """ @@ -174,7 +174,7 @@ async def modify_position( :param position: The new position of the role :type position: int :param reason?: The reason for the modifying - :type reason: Optional[str] + :type reason?: Optional[str] :return: List of guild roles with updated hierarchy :rtype: List[Role] """ diff --git a/interactions/api/models/webhook.py b/interactions/api/models/webhook.py index 743da4b34..4cc1b3411 100644 --- a/interactions/api/models/webhook.py +++ b/interactions/api/models/webhook.py @@ -210,7 +210,7 @@ async def execute( :param tts: true if this is a TTS message :type tts: bool :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first - :type attachments: Optional[List[Attachment]] + :type attachments?: Optional[List[Attachment]] :param embeds: embedded ``rich`` content :type embeds: Union[Embed, List[Embed]] :param allowed_mentions: allowed mentions for the message diff --git a/interactions/client/bot.py b/interactions/client/bot.py index a7f8819e1..7ff23ab3a 100644 --- a/interactions/client/bot.py +++ b/interactions/client/bot.py @@ -50,15 +50,15 @@ class Client: :param token: The token of the application for authentication and connection. :type token: str :param intents?: Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to ``Intents.DEFAULT``. - :type intents: Optional[Intents] + :type intents?: Optional[Intents] :param shards?: Dictates and controls the shards that the application connects under. - :type shards: Optional[List[Tuple[int]]] + :type shards?: Optional[List[Tuple[int]]] :param presence?: Sets an RPC-like presence on the application when connected to the Gateway. - :type presence: Optional[ClientPresence] + :type presence?: Optional[ClientPresence] :param default_scope?: Sets the default scope of all commands. - :type default_scope: Optional[Union[int, Guild, List[int], List[Guild]]] + :type default_scope?: Optional[Union[int, Guild, List[int], List[Guild]]] :param disable_sync?: Controls whether synchronization in the user-facing API should be automatic or not. - :type disable_sync: Optional[bool] + :type disable_sync?: Optional[bool] :ivar AbstractEventLoop _loop: The asynchronous event loop of the client. :ivar HTTPClient _http: The user-facing HTTP connection to the Web API, as its own separate client. @@ -961,25 +961,25 @@ async def sudo(ctx): If ``default_member_permissions`` is not given, this will default to anyone that is able to use the command. :param type?: The type of application command. Defaults to :meth:`interactions.enums.ApplicationCommandType.CHAT_INPUT` or ``1``. - :type type: Optional[Union[str, int, ApplicationCommandType]] + :type type?: Optional[Union[str, int, ApplicationCommandType]] :param name: The name of the application command. This *is* required but kept optional to follow kwarg rules. :type name: Optional[str] :param description?: The description of the application command. This should be left blank if you are not using ``CHAT_INPUT``. - :type description: Optional[str] + :type description?: Optional[str] :param scope?: The "scope"/applicable guilds the application command applies to. - :type scope: Optional[Union[int, Guild, List[int], List[Guild]]] + :type scope?: Optional[Union[int, Guild, List[int], List[Guild]]] :param options?: The "arguments"/options of an application command. This should be left blank if you are not using ``CHAT_INPUT``. - :type options: Optional[Union[Dict[str, Any], List[Dict[str, Any]], Option, List[Option]]] + :type options?: Optional[Union[Dict[str, Any], List[Dict[str, Any]], Option, List[Option]]] :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. - :type name_localizations: Optional[Dict[Union[str, Locale], str]] + :type name_localizations?: Optional[Dict[Union[str, Locale], str]] :param description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. - :type description_localizations: Optional[Dict[Union[str, Locale], str]] + :type description_localizations?: Optional[Dict[Union[str, Locale], str]] :param default_member_permissions?: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` - :type default_member_permissions: Optional[Union[int, Permissions]] + :type default_member_permissions?: Optional[Union[int, Permissions]] :param dm_permission?: The application permissions if executed in a Direct Message. Defaults to ``True``. - :type dm_permission: Optional[bool] + :type dm_permission?: Optional[bool] :param default_scope?: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. - :type default_scope: bool + :type default_scope?: bool :return: A callable response. :rtype: Callable[[Callable[..., Coroutine]], Command] """ @@ -1032,17 +1032,17 @@ async def context_menu_name(ctx): :param name: The name of the application command. :type name: Optional[str] :param scope?: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. - :type scope: Optional[Union[int, Guild, List[int], List[Guild]]] + :type scope?: Optional[Union[int, Guild, List[int], List[Guild]]] :param default_permission?: The default permission of accessibility for the application command. Defaults to ``True``. - :type default_permission: Optional[bool] + :type default_permission?: Optional[bool] :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. - :type name_localizations: Optional[Dict[Union[str, Locale], str]] + :type name_localizations?: Optional[Dict[Union[str, Locale], str]] :param default_member_permissions?: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` - :type default_member_permissions: Optional[Union[int, Permissions]] + :type default_member_permissions?: Optional[Union[int, Permissions]] :param dm_permission?: The application permissions if executed in a Direct Message. Defaults to ``True``. - :type dm_permission: Optional[bool] + :type dm_permission?: Optional[bool] :param default_scope?: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. - :type default_scope: bool + :type default_scope?: bool :return: A callable response. :rtype: Callable[[Callable[..., Coroutine]], Command] """ @@ -1089,17 +1089,17 @@ async def context_menu_name(ctx): :param name: The name of the application command. :type name: Optional[str] :param scope?: The "scope"/applicable guilds the application command applies to. Defaults to ``None``. - :type scope: Optional[Union[int, Guild, List[int], List[Guild]]] + :type scope?: Optional[Union[int, Guild, List[int], List[Guild]]] :param default_permission?: The default permission of accessibility for the application command. Defaults to ``True``. - :type default_permission: Optional[bool] + :type default_permission?: Optional[bool] :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. - :type name_localizations: Optional[Dict[Union[str, Locale], str]] + :type name_localizations?: Optional[Dict[Union[str, Locale], str]] :param default_member_permissions?: The permissions bit value of ``interactions.api.model.flags.Permissions``. If not given, defaults to :meth:`interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS` or ``2147483648`` - :type default_member_permissions: Optional[Union[int, Permissions]] + :type default_member_permissions?: Optional[Union[int, Permissions]] :param dm_permission?: The application permissions if executed in a Direct Message. Defaults to ``True``. - :type dm_permission: Optional[bool] + :type dm_permission?: Optional[bool] :param default_scope?: Whether the scope of the command is the default scope set in the client. Defaults to ``True``. - :type default_scope: bool + :type default_scope?: bool :return: A callable response. :rtype: Callable[[Callable[..., Coroutine]], Command] """ @@ -1298,11 +1298,11 @@ def load( :param name: The name of the extension. :type name: str :param package?: The package of the extension. - :type package: Optional[str] + :type package?: Optional[str] :param \*args?: Optional arguments to pass to the extension :type \**args: tuple :param \**kwargs?: Optional keyword-only arguments to pass to the extension. - :type \**kwargs: dict + :type \**kwargs?: dict :return: The loaded extension. :rtype: Optional[Extension] """ @@ -1337,9 +1337,9 @@ def remove( :param name: The name of the extension. :type name: str :param remove_commands?: Whether to remove commands before reloading. Defaults to True. - :type remove_commands: bool + :type remove_commands?: bool :param package?: The package of the extension. - :type package: Optional[str] + :type package?: Optional[str] """ try: _name: str = resolve_name(name, package) @@ -1393,13 +1393,13 @@ def reload( :param name: The name of the extension :type name: str :param package?: The package of the extension - :type package: Optional[str] + :type package?: Optional[str] :param remove_commands?: Whether to remove commands before reloading. Defaults to True - :type remove_commands: bool + :type remove_commands?: bool :param \*args?: Optional arguments to pass to the extension :type \**args: tuple :param \**kwargs?: Optional keyword-only arguments to pass to the extension. - :type \**kwargs: dict + :type \**kwargs?: dict :return: The reloaded extension. :rtype: Optional[Extension] """ diff --git a/interactions/client/context.py b/interactions/client/context.py index ab78a5396..66e79db75 100644 --- a/interactions/client/context.py +++ b/interactions/client/context.py @@ -120,19 +120,19 @@ async def send( to send an interaction response. :param content?: The contents of the message as a string or string-converted value. - :type content: Optional[str] + :type content?: Optional[str] :param tts?: Whether the message utilizes the text-to-speech Discord programme or not. - :type tts: Optional[bool] + :type tts?: Optional[bool] :param attachments?: The attachments to attach to the message. Needs to be uploaded to the CDN first - :type attachments: Optional[List[Attachment]] + :type attachments?: Optional[List[Attachment]] :param embeds?: An embed, or list of embeds for the message. - :type embeds: Optional[Union[Embed, List[Embed]]] + :type embeds?: Optional[Union[Embed, List[Embed]]] :param allowed_mentions?: The message interactions/mention limits that the message can refer to. - :type allowed_mentions: Optional[MessageInteraction] + :type allowed_mentions?: Optional[MessageInteraction] :param components?: A component, or list of components for the message. - :type components: Optional[Union[ActionRow, Button, SelectMenu, List[Union[ActionRow, Button, SelectMenu]]]] + :type components?: Optional[Union[ActionRow, Button, SelectMenu, List[Union[ActionRow, Button, SelectMenu]]]] :param ephemeral?: Whether the response is hidden or not. - :type ephemeral: Optional[bool] + :type ephemeral?: Optional[bool] :return: The sent message as an object. :rtype: Message """ @@ -411,7 +411,7 @@ async def defer(self, ephemeral: Optional[bool] = False) -> None: to a 15-minute delay between invocation and responding. :param ephemeral?: Whether the deferred state is hidden or not. - :type ephemeral: Optional[bool] + :type ephemeral?: Optional[bool] """ if not self.responded: self.deferred = True @@ -631,9 +631,9 @@ async def defer( to a 15-minute delay between invocation and responding. :param ephemeral?: Whether the deferred state is hidden or not. - :type ephemeral: Optional[bool] + :type ephemeral?: Optional[bool] :param edit_origin?: Whether you want to edit the original message or send a followup message - :type edit_origin: Optional[bool] + :type edit_origin?: Optional[bool] """ if not self.responded: diff --git a/interactions/client/models/command.py b/interactions/client/models/command.py index 601dbeb0f..7614b0f3e 100644 --- a/interactions/client/models/command.py +++ b/interactions/client/models/command.py @@ -233,7 +233,7 @@ async def my_command(ctx, opt: str): :param name: The name of the option. :type name: str :param description?: The description of the option. Defaults to ``"No description set"``. - :type description: str + :type description?: str :param \**kwargs: The keyword arguments of the option, same as :class:`Option`. :type \**kwargs: dict """ @@ -524,17 +524,17 @@ async def subcommand_group(ctx): first create the subcommands without groups, then create the subcommands with groups. :param group?: The name of the group the subcommand belongs to. Defaults to the most recently used group. - :type group: Optional[str] + :type group?: Optional[str] :param name?: The name of the subcommand. Defaults to the name of the coroutine. - :type name: Optional[str] + :type name?: Optional[str] :param description?: The description of the subcommand. Defaults to the docstring of the coroutine. - :type description: Optional[str] + :type description?: Optional[str] :param options?: The options of the subcommand. - :type options: Optional[List[Option]] + :type options?: Optional[List[Option]] :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. - :type name_localizations: Optional[Dict[Union[str, Locale], str]] + :type name_localizations?: Optional[Dict[Union[str, Locale], str]] :param description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. - :type description_localizations: Optional[Dict[Union[str, Locale], str]] + :type description_localizations?: Optional[Dict[Union[str, Locale], str]] :return: The :class:`interactions.client.models.command.Command` object. :rtype: Command """ @@ -631,13 +631,13 @@ async def subcommand_group(ctx): first create the subcommands without groups, then create the subcommands with groups. :param name?: The name of the group. Defaults to the name of the coroutine. - :type name: Optional[str] + :type name?: Optional[str] :param description?: The description of the group. Defaults to the docstring of the coroutine. - :type description: Optional[str] + :type description?: Optional[str] :param name_localizations?: The dictionary of localization for the ``name`` field. This enforces the same restrictions as the ``name`` field. - :type name_localizations: Optional[Dict[Union[str, Locale], str]] + :type name_localizations?: Optional[Dict[Union[str, Locale], str]] :param description_localizations?: The dictionary of localization for the ``description`` field. This enforces the same restrictions as the ``description`` field. - :type description_localizations: Optional[Dict[Union[str, Locale], str]] + :type description_localizations?: Optional[Dict[Union[str, Locale], str]] :return: The :class:`interactions.client.models.command.Command` object. :rtype: Command """ @@ -740,7 +740,7 @@ def autocomplete( Decorator for creating an autocomplete for the command. :param name?: The name of the option to autocomplete. Defaults to the name of the coroutine. - :type name: Optional[str] + :type name?: Optional[str] :return: The coroutine :rtype: Callable[..., Coroutine] """ diff --git a/interactions/client/models/utils.py b/interactions/client/models/utils.py index 3422865a2..ea6f31a9a 100644 --- a/interactions/client/models/utils.py +++ b/interactions/client/models/utils.py @@ -32,11 +32,11 @@ async def command(ctx): await ctx.send("I'm awake now!") :param delay?: The amount of time in seconds to wait before defering the command. Defaults to ``2`` seconds. - :type delay: Union[float, int] + :type delay?: Union[float, int] :param ephemeral?: Whether the command is deferred ephemerally. Defaults to ``False``. - :type ephemeral: bool + :type ephemeral?: bool :param edit_origin?: Whether the command is deferred on origin. Defaults to ``False``. - :type edit_origin: bool + :type edit_origin?: bool :return: The inner function, for decorating. :rtype: """ @@ -102,7 +102,7 @@ async def command(ctx): :param \*components: The components to spread. :type \*components: Union[ActionRow, Button, SelectMenu] :param max_in_row?: The maximum number of components in a single row. Defaults to ``5``. - :type max_in_row: int + :type max_in_row?: int """ if not components or len(components) > 25: raise LibraryException(code=12, message="Number of components should be between 1 and 25.") diff --git a/interactions/ext/base.py b/interactions/ext/base.py index 1a98b32af..b9c66ea96 100644 --- a/interactions/ext/base.py +++ b/interactions/ext/base.py @@ -56,13 +56,13 @@ def __init__( :param description: The description of the library, e.g. the purpose. :type description: str :param long_description?: The full description of the library, e.g. README. Defaults to ``None``. - :type long_description: Optional[str] + :type long_description?: Optional[str] :param packages?: The package(s) of the library. Defaults to ``None``. - :type packages: Optional[List[str]] + :type packages?: Optional[List[str]] :param requirements?: The required modules needed for library function. Defaults to ``None``. - :type requirements: Optional[List[str]] + :type requirements?: Optional[List[str]] :param kwargs?: Any other keyword arguments. Defaults to ``None``. - :type kwargs: Optional[dict] + :type kwargs?: Optional[dict] """ self.version: Version = version self.name: str = name diff --git a/interactions/ext/version.py b/interactions/ext/version.py index 2269bb57b..f37b2f161 100644 --- a/interactions/ext/version.py +++ b/interactions/ext/version.py @@ -44,11 +44,11 @@ def __init__( :param name: The name of the author. :type name: str :param shared?: The author's relationship as the main or co-author. Defaults to ``False``. - :type shared: Optional[bool] + :type shared?: Optional[bool] :param active?: The author's state of activity. Defaults to ``True``. - :type active: Optional[bool] + :type active?: Optional[bool] :param email?: The author's email address or point of contact. Defaults to ``None``. - :type email: Optional[str] + :type email?: Optional[str] """ self.name = name self._co_author = shared @@ -94,13 +94,13 @@ class Version: def __init__(self, **kwargs) -> None: """ :param major?: The major version. If not specified, ``version`` will be read from. - :type major: Optional[Union[str, int]] + :type major?: Optional[Union[str, int]] :param minor?: The minor version. If not specified, ``version`` will be read from. - :type minor: Optional[Union[str, int]] + :type minor?: Optional[Union[str, int]] :param patch?: The patch version. If not specified, ``version`` will be read from. - :type patch: Optional[Union[str, int]] + :type patch?: Optional[Union[str, int]] :param version?: The overall version. Must be used if ``major``, ``minor`` or ``patch`` are not. - :type version: Optional[str] + :type version?: Optional[str] """ self._major = int(kwargs.get("major") or kwargs.get("version", "0.0.0").split(".")[0]) self._minor = int(kwargs.get("minor") or kwargs.get("version", "0.0.0").split(".")[1])