Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion interactions/api/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, [])
Expand Down
12 changes: 6 additions & 6 deletions interactions/api/gateway/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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]
"""
Expand Down Expand Up @@ -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]
"""
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion interactions/api/http/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
"""
Expand Down
2 changes: 1 addition & 1 deletion interactions/api/http/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
94 changes: 47 additions & 47 deletions interactions/api/models/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand Down Expand Up @@ -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]
"""
Expand Down Expand Up @@ -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
"""
Expand Down Expand Up @@ -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:
Expand Down
Loading