Channel Models#

enum interactions.api.models.channel.ChannelType(value)[source]#

An enumerable object representing the type of channels.

Member Type:

int

Valid values are as follows:

GUILD_TEXT = <ChannelType.GUILD_TEXT: 0>#
DM = <ChannelType.DM: 1>#
GUILD_VOICE = <ChannelType.GUILD_VOICE: 2>#
GROUP_DM = <ChannelType.GROUP_DM: 3>#
GUILD_CATEGORY = <ChannelType.GUILD_CATEGORY: 4>#
GUILD_ANNOUNCEMENT = <ChannelType.GUILD_ANNOUNCEMENT: 5>#
GUILD_STORE = <ChannelType.GUILD_STORE: 6>#
ANNOUNCEMENT_THREAD = <ChannelType.ANNOUNCEMENT_THREAD: 10>#
PUBLIC_THREAD = <ChannelType.PUBLIC_THREAD: 11>#
PRIVATE_THREAD = <ChannelType.PRIVATE_THREAD: 12>#
GUILD_STAGE_VOICE = <ChannelType.GUILD_STAGE_VOICE: 13>#
GUILD_DIRECTORY = <ChannelType.GUILD_DIRECTORY: 14>#
GUILD_FORUM = <ChannelType.GUILD_FORUM: 15>#
class interactions.api.models.channel.Thread(kwargs_dict=None, /, **other_kwargs)[source]#

Nouveau dans la version 4.0.2.

An object representing a thread.

Note

This is a derivation of the base Channel, since a thread can be its own event.

class interactions.api.models.channel.Channel(kwargs_dict=None, /, **other_kwargs)[source]#

A class object representing all types of channels.

Variables:
  • id (Snowflake) – The (snowflake) ID of the channel.

  • type (ChannelType) – The type of channel.

  • guild_id (Optional[Snowflake]) – The ID of the guild if it is not a DM channel.

  • position (Optional[int]) – The position of the channel.

  • permission_overwrites (List[Overwrite]) – The non-synced permissions of the channel.

  • name (str) – The name of the channel.

  • topic (Optional[str]) – The description of the channel.

  • nsfw (Optional[bool]) – Whether the channel is NSFW.

  • last_message_id (Snowflake) – The ID of the last message sent.

  • bitrate (Optional[int]) – The audio bitrate of the channel.

  • user_limit (Optional[int]) – The maximum amount of users allowed in the channel.

  • rate_limit_per_user (Optional[int]) – The concurrent ratelimit for users in the channel.

  • recipients (Optional[List[User]]) – The recipients of the channel.

  • icon (Optional[str]) – The icon of the channel.

  • owner_id (Optional[Snowflake]) – The owner of the channel.

  • application_id (Optional[Snowflake]) – The application of the channel.

  • parent_id (Optional[Snowflake]) – The ID of the « parent »/main channel.

  • last_pin_timestamp (Optional[datetime]) – The timestamp of the last pinned message in the channel.

  • rtc_region (Optional[str]) – The region of the WebRTC connection for the channel.

  • video_quality_mode (Optional[int]) – The set quality mode for video streaming in the channel.

  • message_count (int) – The amount of messages in the channel.

  • member_count (Optional[int]) – The amount of members in the channel.

  • newly_created (Optional[bool]) – Boolean representing if a thread is created.

  • thread_metadata (Optional[ThreadMetadata]) – The thread metadata of the channel.

  • member (Optional[ThreadMember]) – The member of the thread in the channel.

  • default_auto_archive_duration (Optional[int]) – The set auto-archive time for all threads to naturally follow in the channel.

  • permissions (Optional[Permissions]) – The permissions of the channel.

  • flags (Optional[int]) – The flags of the channel.

  • total_message_sent (Optional[int]) – Number of messages ever sent in a thread.

  • default_thread_slowmode_delay (Optional[int]) – The default slowmode delay in seconds for threads, if this channel is a forum.

  • available_tags (Optional[List[Tags]]) – Tags in a forum channel, if any.

  • applied_tags (Optional[List[Snowflake]]) – The IDs of tags that have been applied to a thread, if any.

  • default_reaction_emoji (Optional[Emoji]) – Default reaction emoji for threads created in a forum, if any.

property guild_id: Snowflake | None#

Nouveau dans la version 4.4.0.

Attempts to get the guild ID the channel is in.

Renvoie:

The ID of the guild this channel belongs to.

Type renvoyé:

Optional[Snowflake]

property guild: Guild | None#

Nouveau dans la version 4.4.0.

Attempts to get the guild the channel is in.

Renvoie:

The guild this channel belongs to.

Type renvoyé:

Guild

property typing: Awaitable | AbstractContextManager#

Nouveau dans la version 4.3.2.

Manages the typing of the channel. Use with await or async with

Renvoie:

A manager for typing

Type renvoyé:

AsyncTypingContextManager

property mention: str#

Nouveau dans la version 4.1.0.

Returns a string that allows you to mention the given channel.

Renvoie:

The string of the mentioned channel.

Type renvoyé:

str

property voice_states: List[VoiceState]#

Nouveau dans la version 4.4.0.

Returns all voice states this channel has. Only applicable for voice channels.

Type renvoyé:

List[VoiceState]

property created_at: datetime#

Nouveau dans la version 4.4.0.

Returns when the channel was created.

history(start_at=<interactions.MISSING>, reverse=False, maximum=inf, check=None)[source]#

Nouveau dans la version 4.3.2.

Paramètres:
  • start_at (Optional[Union[int, str, Snowflake, Message]]) – The message to begin getting the history from

  • reverse (Optional[bool]) – Whether to only get newer message. Default False

  • maximum (Optional[int]) – A set maximum of messages to get before stopping the iteration

  • check (Optional[Callable[[Message], Union[bool, Awaitable[bool]]]]) – A custom check to ignore certain messages

Renvoie:

An asynchronous iterator over the history of the channel

Type renvoyé:

AsyncHistoryIterator

async send(content=<interactions.MISSING>, *, tts=<interactions.MISSING>, attachments=<interactions.MISSING>, files=<interactions.MISSING>, embeds=<interactions.MISSING>, allowed_mentions=<interactions.MISSING>, stickers=<interactions.MISSING>, components=<interactions.MISSING>)[source]#

Nouveau dans la version 4.0.2.

Sends a message in the channel.

Paramètres:
  • content (Optional[str]) – The contents of the message as a string or string-converted value.

  • tts (Optional[bool]) – Whether the message utilizes the text-to-speech Discord programme or not.

  • files (Optional[Union[File, List[File]]]) –

    Nouveau dans la version 4.2.0.

    A file or list of files to be attached to the message.

  • attachments (Optional[List[Attachment]]) –

    Nouveau dans la version 4.3.0.

    The attachments to attach to the message. Needs to be uploaded to the CDN first.

  • embeds (Optional[Union[Embed, List[Embed]]]) – An embed, or list of embeds for the message.

  • allowed_mentions (Optional[Union[AllowedMentions, dict]]) – The allowed mentions for the message.

  • stickers (Optional[List[Sticker]]) –

    Nouveau dans la version 4.3.0.

    A list of stickers to send with your message. You can send up to 3 stickers per message.

  • components (Optional[Union[ActionRow, Button, SelectMenu, List[Actionrow], List[Button], List[SelectMenu]]]) – A component, or list of components for the message.

Renvoie:

The sent message as an object.

Type renvoyé:

Message

async delete()[source]#

Nouveau dans la version 4.0.2.

Deletes the channel.

async modify(name=<interactions.MISSING>, topic=<interactions.MISSING>, bitrate=<interactions.MISSING>, user_limit=<interactions.MISSING>, rate_limit_per_user=<interactions.MISSING>, position=<interactions.MISSING>, permission_overwrites=<interactions.MISSING>, parent_id=<interactions.MISSING>, nsfw=<interactions.MISSING>, archived=<interactions.MISSING>, auto_archive_duration=<interactions.MISSING>, locked=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.0.2.

Edits the channel.

Nouveau dans la version 4.2.0: The fields archived, auto_archive_duration and locked. All require the provided channel to be a thread.

Paramètres:
  • name (Optional[str]) – The name of the channel, defaults to the current value of the channel

  • topic (Optional[str]) – The topic of that channel, defaults to the current value of the channel

  • bitrate (Optional[int]) – (voice channel only) The bitrate (in bits) of the voice channel, defaults to the current value of the channel

  • user_limit (Optional[int]) – (voice channel only) Maximum amount of users in the channel, defaults to the current value of the channel

  • rate_limit_per_user (Optional[int]) – Amount of seconds a user has to wait before sending another message (0-21600), defaults to the current value of the channel

  • position (Optional[int]) – Sorting position of the channel, defaults to the current value of the channel

  • parent_id (Optional[int]) – The id of the parent category for a channel, defaults to the current value of the channel

  • nsfw (Optional[bool]) – Whether the channel is nsfw or not, defaults to the current value of the channel

  • permission_overwrites (Optional[List[Overwrite]]) – The permission overwrites, if any

  • archived (Optional[bool]) –

    Nouveau dans la version 4.2.0.

    Whether the thread is archived

  • auto_archive_duration (Optional[int]) –

    Nouveau dans la version 4.2.0.

    The time after the thread is automatically archived. One of 60, 1440, 4320, 10080

  • locked (Optional[bool]) –

    Nouveau dans la version 4.2.0.

    Whether the thread is locked

  • reason (Optional[str]) – The reason for the edit

Renvoie:

The modified channel as new object

Type renvoyé:

Channel

async set_name(name, *, reason=None)[source]#

Nouveau dans la version 4.1.0.

Sets the name of the channel.

Paramètres:
  • name (str) – The new name of the channel

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async set_topic(topic, *, reason=None)[source]#

Nouveau dans la version 4.1.0.

Sets the topic of the channel.

Paramètres:
  • topic (str) – The new topic of the channel

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async set_bitrate(bitrate, *, reason=None)[source]#

Nouveau dans la version 4.1.0.

Sets the bitrate of the channel.

Paramètres:
  • bitrate (int) – The new bitrate of the channel

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async set_user_limit(user_limit, *, reason=None)[source]#

Nouveau dans la version 4.1.0.

Sets the user_limit of the channel.

Paramètres:
  • user_limit (int) – The new user limit of the channel

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async set_rate_limit_per_user(rate_limit_per_user, *, reason=None)[source]#

Nouveau dans la version 4.1.0.

Sets the amount of seconds a user has to wait before sending another message.

Paramètres:
  • rate_limit_per_user (int) – The new rate_limit_per_user of the channel (0-21600)

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async set_position(position, *, reason=None)[source]#

Nouveau dans la version 4.1.0.

Sets the position of the channel.

Paramètres:
  • position (int) – The new position of the channel

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async set_parent_id(parent_id, *, reason=None)[source]#

Nouveau dans la version 4.1.0.

Sets the parent_id of the channel.

Paramètres:
  • parent_id (int) – The new parent_id of the channel

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async set_nsfw(nsfw, *, reason=None)[source]#

Nouveau dans la version 4.1.0.

Sets the nsfw-flag of the channel.

Paramètres:
  • nsfw (bool) – The new nsfw-flag of the channel

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async archive(archived=True, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the archived state of the thread.

Paramètres:
  • archived (bool) – Whether the Thread is archived, defaults to True

  • reason (Optional[str]) – The reason of the archiving

Renvoie:

The edited channel

Type renvoyé:

Channel

async set_auto_archive_duration(auto_archive_duration, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the time after the thread is automatically archived.

Paramètres:
  • auto_archive_duration (int) – The time after the thread is automatically archived. One of 60, 1440, 4320, 10080

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async lock(locked=True, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the locked state of the thread.

Paramètres:
  • locked (bool) – Whether the Thread is locked, defaults to True

  • reason (Optional[str]) – The reason of the edit

Renvoie:

The edited channel

Type renvoyé:

Channel

async add_member(member_id)[source]#

Nouveau dans la version 4.2.0.

This adds a member to the channel, if the channel is a thread.

Paramètres:

member_id (int) – The id of the member to add to the channel

async remove_member(member_id)[source]#

Nouveau dans la version 4.3.0.

This removes a member of the channel, if the channel is a thread.

Paramètres:

member_id (int) – The id of the member to remove of the channel

async pin_message(message_id)[source]#

Nouveau dans la version 4.0.2.

Pins a message to the channel.

Paramètres:

message_id (Union[int, Snowflake, Message]) – The id of the message to pin

async unpin_message(message_id)[source]#

Nouveau dans la version 4.0.2.

Unpins a message from the channel.

Paramètres:

message_id (Union[int, Snowflake, Message]) – The id of the message to unpin

async publish_message(message_id)[source]#

Nouveau dans la version 4.0.2.

Publishes (API calls it crossposts) a message in the channel to any that is followed by.

Paramètres:

message_id (Union[int, Snowflake, Message]) – The id of the message to publish

Renvoie:

The message published

Type renvoyé:

Message

async get_pinned_messages()[source]#

Nouveau dans la version 4.0.2.

Get all pinned messages from the channel.

Renvoie:

A list of pinned message objects.

Type renvoyé:

List[Message]

async get_message(message_id)[source]#

Nouveau dans la version 4.1.0.

Gets a message sent in that channel.

Paramètres:

message_id (Union[int, Snowflake]) – The ID of the message to get

Renvoie:

The message as object

Type renvoyé:

Message

async purge(amount, check=<interactions.MISSING>, before=<interactions.MISSING>, reason=None, bulk=True, force_bulk=False)[source]#

Nouveau dans la version 4.1.0.

Purges a given amount of messages from a channel. You can specify a check function to exclude specific messages.

Avertissement

Calling this method can lead to rate-limits when purging higher amounts of messages.

def check_pinned(message):
    return not message.pinned  # This returns `True` only if the message is the message is not pinned
await channel.purge(100, check=check_pinned)
# This will delete the newest 100 messages that are not pinned in that channel
Paramètres:
  • amount (int) – The amount of messages to delete

  • check (Optional[Callable[[Any], Union[bool, Awaitable[bool]]]]) – The function used to check if a message should be deleted. The message is only deleted if the check returns True

  • before (Optional[int]) – An id of a message to purge only messages before that message

  • bulk (Optional[bool]) –

    Whether to use the bulk delete endpoint for deleting messages. This only works for 14 days

    Modifié dans la version 4.4.0: Purge now automatically continues deleting messages even after the 14 days limit was hit. Check force_bulk for more information. If the 14 days span is exceeded the bot will encounter rate-limits more frequently.

  • reason (Optional[st]) – The reason of the deletes

  • force_bulk (Optional[bool]) –

    Nouveau dans la version 4.4.0: Whether to stop deleting messages when the 14 days bulk limit was hit, default False

Renvoie:

A list of the deleted messages

Type renvoyé:

List[Message]

async create_thread(name, type=ChannelType.PUBLIC_THREAD, auto_archive_duration=<interactions.MISSING>, invitable=<interactions.MISSING>, message_id=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.1.0.

Creates a thread in the Channel.

Paramètres:
  • name (str) – The name of the thread

  • auto_archive_duration (Optional[int]) – duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080

  • type (Optional[ChannelType]) – The type of thread, defaults to public. ignored if creating thread from a message

  • invitable (Optional[bool]) – Boolean to display if the Thread is open to join or private.

  • message_id (Optional[Union[int, Snowflake, Message]]) – An optional message to create a thread from.

  • reason (Optional[str]) – An optional reason for the audit log

Renvoie:

The created thread

Type renvoyé:

Channel

property url: str#

Nouveau dans la version 4.2.0.

Returns the URL of the channel

async create_invite(max_age=86400, max_uses=0, temporary=False, unique=False, target_type=<interactions.MISSING>, target_user_id=<interactions.MISSING>, target_application_id=<interactions.MISSING>, reason=None)[source]#

Creates an invite for the channel

Paramètres:
  • max_age (Optional[int]) – Duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days). Default 86400 (24h)

  • max_uses (Optional[int]) – Max number of uses or 0 for unlimited. between 0 and 100. Default 0

  • temporary (Optional[bool]) – Whether this invite only grants temporary membership. Default False

  • unique (Optional[bool]) – If true, don’t try to reuse a similar invite (useful for creating many unique one time use invites). Default False

  • target_type (Optional[InviteTargetType]) – The type of target for this voice channel invite

  • target_user_id (Optional[int]) – 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

  • target_application_id (Optional[int]) – 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

  • reason (Optional[str]) – The reason for the creation of the invite

Type renvoyé:

Invite

async get_history(limit=100)[source]#

Nouveau dans la version 4.2.0.

Obsolète depuis la version 4.3.2: Use the history() method instead

Gets messages from the channel’s history.

Paramètres:

limit (int) – The amount of messages to get. Default 100

Renvoie:

A list of messages

Type renvoyé:

List[Message]

async get_webhooks()[source]#

Nouveau dans la version 4.3.0.

Gets a list of webhooks of that channel

Type renvoyé:

List[Webhook]

async get_members()[source]#

Nouveau dans la version 4.3.0.

Gets the list of thread members

Renvoie:

The members of the thread.

Type renvoyé:

List[ThreadMember]

async leave()[source]#

Nouveau dans la version 4.3.0.

Removes the bot from the thread

async join()[source]#

Nouveau dans la version 4.3.0.

Add the bot to the thread

async create_tag(name, emoji_id=<interactions.MISSING>, emoji_name=<interactions.MISSING>)[source]#

Nouveau dans la version 4.3.2.

Create a new tag.

Note

Can either have an emoji_id or an emoji_name, but not both. emoji_id is meant for custom emojis, emoji_name is meant for unicode emojis.

Paramètres:
  • name (str) – The name of the tag

  • emoji_id (Optional[int]) – The ID of the emoji to use for the tag

  • emoji_name (Optional[str]) – The name of the emoji to use for the tag

Renvoie:

The create tag object

Type renvoyé:

Tags

async edit_tag(tag_id, name, emoji_name=<interactions.MISSING>, emoji_id=<interactions.MISSING>)[source]#

Nouveau dans la version 4.3.2.

Edits a tag

Note

Can either have an emoji_id or an emoji_name, but not both. emoji_id is meant for custom emojis, emoji_name is meant for unicode emojis.

Paramètres:
  • tag_id (Union[int, str, Snowflake, Tags]) – The ID of the tag to edit

  • name (str) – The new name of the tag

  • emoji_id (Optional[int]) – The ID of the emoji to use for the tag

  • emoji_name (Optional[int]) – The name of the emoji to use for the tag

Renvoie:

The modified tag

Type renvoyé:

Tags

async delete_tag(tag_id)[source]#

Nouveau dans la version 4.3.2.

Deletes a tag

Paramètres:

tag_id (Union[int, str, Snowflake, Tags]) – The ID of the Tag

async create_forum_post(name, content, auto_archive_duration=<interactions.MISSING>, applied_tags=<interactions.MISSING>, files=<interactions.MISSING>, rate_limit_per_user=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.3.2.

Creates a new post inside a forum channel

Paramètres:
  • name (str) – The name of the thread

  • auto_archive_duration (Optional[int]) – duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080

  • content (Union[dict, Message, str, Attachment, List[Attachment]]) – The content to send as first message.

  • applied_tags (Union[List[str], List[int], List[Tags], int, str, Tags]) – Tags to give to the created thread

  • files (Optional[List[File]]) – An optional list of files to send attached to the message.

  • rate_limit_per_user (Optional[int]) – Seconds a user has to wait before sending another message (0 to 21600), if given.

  • reason (Optional[str]) – An optional reason for the audit log

Renvoie:

A channel of type ChannelType.PUBLIC_THREAD

Type renvoyé:

Channel

async get_permissions_for(member)[source]#

Nouveau dans la version 4.3.2.

Returns the permissions of the member in this specific channel.

Note

The permissions returned by this function take into account role and user overwrites that can be assigned to channels or categories. If you don’t need these overwrites, look into Member.get_guild_permissions().

Paramètres:

member (Member) – The member to get the permissions from

Renvoie:

Permissions of the member in this channel

Type renvoyé:

Permissions

async add_permission_overwrite(id, type=<interactions.MISSING>, allow=<interactions.MISSING>, deny=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.4.0.

Adds a permission overwrite to the channel.

Paramètres:
  • id (Union[int, str, Snowflake, User, Role]) – The ID of the User/Role to create the overwrite on.

  • type (Optional[Literal[0, 1, "0", "1"]]) – The type of the overwrite. 0 for Role 1 for User.

  • allow (Optional[Union[int, Permissions, str]]) – Permissions to allow

  • deny (Optional[Union[int, Permissions, str]]) – Permissions to deny

  • reason (Optional[str]) – The reason to be shown in the audit log

Renvoie:

The updated channel

Type renvoyé:

Channel

async add_permission_overwrites(overwrites, reason=None)[source]#

Nouveau dans la version 4.4.0.

Add multiple overwrites to the channel.

Paramètres:
  • overwrites (Iterable[Overwrite]) – The overwrites to add to the channel.

  • reason (Optional[str]) – The reason to be shown in the audit log

Renvoie:

The updated channel

Type renvoyé:

Channel

async overwrite_permission_overwrites(overwrites, reason=None)[source]#

Nouveau dans la version 4.4.0.

Overwrites the overwrites of the channel with new overwrites.

Paramètres:
  • overwrites (Iterable[Overwrite]) – The overwrites to add to the channel.

  • reason (Optional[str]) – The reason to be shown in the audit log

Renvoie:

The updated channel

Type renvoyé:

Channel

async remove_permission_overwrite_for(id, reason=None)[source]#

Nouveau dans la version 4.4.0.

Removes the overwrite for the given ID.

Paramètres:
  • id (Union[int, str, Snowflake, User, Role, Overwrite]) – The ID of the User/Role to create the overwrite on.

  • reason (Optional[str]) – The reason to be shown in the audit log

Renvoie:

The updated channel

Type renvoyé:

Channel

class interactions.api.models.channel.ThreadMember(kwargs_dict=None, /, **other_kwargs)[source]#

A class object representing a member in a thread.

Note

id only shows if there are active intents involved with the member in the thread.

Variables:
  • id (Optional[Snowflake]) – The « ID » or intents of the member.

  • user_id (Snowflake) – The user ID of the member.

  • join_timestamp (datetime) – The timestamp of when the member joined the thread.

  • flags (int) – The bitshift flags for the member in the thread.

  • muted (bool) – Whether the member is muted or not.

class interactions.api.models.channel.ThreadMetadata(kwargs_dict=None, /, **other_kwargs)[source]#

A class object representing the metadata of a thread.

Note

invitable will only show if the thread can have an invited created with the current cached permissions.

Variables:
  • archived (bool) – The current thread accessibility state.

  • auto_archive_duration (int) – The auto-archive time.

  • archive_timestamp (datetime) – The timestamp that the thread will be/has been closed at.

  • locked (bool) – The current message state of the thread.

  • invitable (Optional[bool]) – The ability to invite users to the thread.

class interactions.api.models.channel.AsyncHistoryIterator(_client, obj, maximum=inf, start_at=<interactions.MISSING>, check=None, reverse=False)[source]#

Nouveau dans la version 4.3.2.

A class object that allows iterating through a channel’s history.

Paramètres:
  • _client (HTTPClient) – The HTTPClient of the bot

  • obj (Union[int, str, Snowflake, Channel]) – The channel to get the history from

  • start_at (Optional[Union[int, str, Snowflake, Message]]) – The message to begin getting the history from

  • reverse (Optional[bool]) – Whether to only get newer message. Default False

  • check (Optional[Callable[[Message], Union[bool, Awaitable[bool]]]]) – A check to ignore certain messages

  • maximum (Optional[int]) – A set maximum of messages to get before stopping the iteration

async flatten()[source]#

Returns all remaining items as list

Type renvoyé:

List[Message]

class interactions.api.models.channel.AsyncTypingContextManager(obj, _client)[source]#

Nouveau dans la version 4.3.2.

An async context manager for triggering typing.

Paramètres:
  • obj (Union[int, str, Snowflake, Channel]) – The channel to trigger typing in.

  • _client (HTTPClient) – The HTTPClient of the bot

class interactions.api.models.channel.Tags(kwargs_dict=None, /, **other_kwargs)[source]#

Nouveau dans la version 4.3.2.

An object denoting a tag object within a forum channel.

Note

If the emoji is custom, it won’t have name information.

Variables:
  • name (str) – Name of the tag. The limit is up to 20 characters.

  • id (Snowflake) – ID of the tag. Can also be 0 if manually created.

  • moderated (bool) – A boolean denoting whether this tag can be removed/added by moderators with the Permissions.MANAGE_THREADS permission.

  • emoji_name (Optional[str]) – The unicode character of the emoji.

  • emoji_id (Optional[Snowflake]) – The id of a guild’s custom emoji.

property emoji: Emoji#

Returns an emoji of tag.

property created_at: datetime#

Nouveau dans la version 4.4.0.

Returns when the tag was created.

async delete(channel_id)[source]#

Deletes this tag

Paramètres:

channel_id (Union[int, str, Snowflake, Channel]) – The ID of the channel where the tag belongs to

async edit(channel_id, name, emoji_name=<interactions.MISSING>, emoji_id=<interactions.MISSING>)[source]#

Edits this tag

Note

Can either have an emoji_id or an emoji_name, but not both. emoji_id is meant for custom emojis, emoji_name is meant for unicode emojis.

Paramètres:
  • channel_id (Union[int, str, Snowflake, Channel]) – The ID of the channel where the tag belongs to

  • name (str) – The new name of the tag

  • emoji_id (Optional[int]) – The ID of the emoji to use for the tag

  • emoji_name (Optional[int]) – The name of the emoji to use for the tag

Renvoie:

The modified tag

Type renvoyé:

Tags