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])