discordaio.channel
¶
Contains all related Channel Discord objects
Classes¶
Channel
: Represents a guild or DM channel within Discord.ChannelMessage
: Represents a message sent in a channel within Discord.Overwrite
: Represents a Overwrite object.MessageActivity
: Represents a Message Activity.MessageApplication
: Represents a Message Application.Reaction
: Represents a Reaction.Embed
: Represents a discord EmbedEmbedThumbnail
: Represents a embed thumbnail objectEmbedVideo
: Represents a embed videoEmbedImage
: Represents a embed imageEmbedProvider
: Represents a embed providerEmbedAuthor
: Represents a embed authorEmbedFooter
: Represents a embed footerEmbedField
: Represents a embed fieldAttachment
: Represents a attachment
-
class
discordaio.channel.
Channel
(id: int = None, type: int = 0, guild_id: int = None, position: int = None, permission_overwrites: List[discordaio.channel.Overwrite] = [], name: str = None, topic: str = None, nsfw: bool = False, last_message_id: int = None, bitrate: int = None, user_limit: int = None, recipients: List[discordaio.user.User] = [], icon: str = None, owner_id: int = None, application_id: int = None, parent_id: int = None, last_pin_timestamp: int = None)[source]¶ Represents a guild or DM channel within Discord.
New in version 0.2.0.
-
id
¶ the id of this channel
-
type
¶ the value_type of channel
-
guild_id
¶ the id of the guild
-
position
¶ sorting position of the channel
-
permission_overwrites
¶ explicit permission overwrites for members and roles
-
name
¶ the name of the channel (2-100 characters)
-
topic the channel topic
Type: 0-1024 characters
-
nsfw
¶ if the channel is nsfw
-
last_message_id
¶ the id of the last message sent in this channel (may not point to an existing or valid message)
-
bitrate
¶ the bitrate (in bits) of the voice channel
-
user_limit
¶ the user limit of the voice channel
-
recipients
¶ the recipients of the DM
-
icon
¶ icon hash
-
owner_id
¶ id of the DM creator
-
application_id application id of the group DM creator if it is bot-created
-
parent_id
¶ id of the parent category for a channel
-
last_pin_timestamp
¶ timestamp when the last pinned message was pinned
Inheritance
-
await
bulk_delete_messages
(ids: List[T])[source]¶ Delete multiple messages in a single request. This endpoint can only be used on guild channels and requires the MANAGE_MESSAGES permission.
This endpoint will not delete messages older than 2 weeks, and will fail if any message provided is older than that.
New in version 0.3.0.
-
await
create_invite
(max_age: int, max_uses=0, temporary=False, unique=False) → discordaio.invite.Invite[source]¶ Create a new invite object for the channel. Only usable for guild channels. Requires the CREATE_INSTANT_INVITE permission.
New in version 0.3.0.
-
await
delete_permission
(overwrite_id)[source]¶ Delete a channel permission overwrite for a user or role in a channel. Only usable for guild channels. Requires the MANAGE_ROLES permission.
New in version 0.3.0.
-
await
delete_pinned_message
(message_id)[source]¶ Delete a pinned message. Requires the MANAGE_MESSAGES permission.
New in version 0.3.0.
-
await
get_invites
() → List[discordaio.invite.Invite][source]¶ Returns a list of invite objects (with invite metadata) for the channel. Only usable for guild channels. Requires the MANAGE_CHANNELS permission.
New in version 0.3.0.
-
await
get_message
(message_id) → discordaio.channel.ChannelMessage[source]¶ Gets a specific channel message.
-
await
get_messages
(limit: int = None, around: int = None, before: int = None, after: int = None) → List[discordaio.channel.ChannelMessage][source]¶ Gets channel messages
New in version 0.3.0.
-
await
get_pinned_messages
() → List[discordaio.channel.ChannelMessage][source]¶ Returns all pinned messages in the channel as an array of message objects.
New in version 0.3.0.
-
await
pin_message
(message_id)[source]¶ Pin a message in a channel. Requires the MANAGE_MESSAGES permission.
New in version 0.3.0.
-
await
refresh
() → discordaio.channel.Channel[source]¶ Returns a “refreshed” channel instance, may be used to make sure you have the latest state of the channel.
New in version 0.3.0.
Example
channel = await channel.refresh()
Returns: The requested channel.
-
-
class
discordaio.channel.
ChannelMessage
(id=None, channel_id=None, author: discordaio.user.User = None, content: str = None, timestamp: int = None, edited_timestamp: int = None, tts: bool = False, mention_everyone: bool = False, mentions: List[discordaio.user.User] = [], mention_roles: List[discordaio.role.Role] = [], attachments: List[discordaio.channel.Attachment] = [], embeds: List[discordaio.channel.Embed] = [], reactions: List[discordaio.channel.Reaction] = [], nonce: int = None, pinned=False, webhook_id=None, type=None, activity=<discordaio.channel.MessageActivity object>, application=<discordaio.channel.MessageApplication object>)[source]¶ Represents a message sent in a channel within Discord.
New in version 0.2.0.
Note
The author object follows the structure of the
User
object, but is only a valid user in the case where the message is generated by a user or bot user. If the message is generated by aWebhook
, the author object corresponds to the webhook’s id, username, and avatar. You can tell if a message is generated by a webhook by checking for the webhook_id on the message object.-
id
¶ id of the message
-
channel_id
¶ id of the channel the message was sent in
the author of this message (not guaranteed to be a valid user, see below)
-
content
¶ contents of the message
-
timestamp
¶ timestamp when this message was sent
-
edited_timestamp
¶ timestamp when this message was edited (or null if never)
-
tts
¶ whether this was a TTS message
-
mention_everyone
¶ whether this message mentions everyone
-
mentions
¶ objects users specifically mentioned in the message
-
mention_roles
¶ object ids roles specifically mentioned in this message
-
attachments
¶ objects any attached files
-
embeds
¶ objects any embedded content
-
reactions
¶ objects reactions to the message
-
nonce
¶ used for validating a message was sent
-
pinned whether this message is pinned
-
webhook_id
¶ if the message is generated by a webhook, this is the webhook’s id
-
type
¶ type of message
-
activity
¶ activity object sent with Rich Presence-related chat embeds
-
application
¶ application object sent with Rich Presence-related chat embeds
Inheritance
-
await
delete
()[source]¶ Delete a message. If operating on a guild channel and trying to delete a message that was not sent by the current user, this endpoint requires the MANAGE_MESSAGES permission
-
await
delete_all_reactions
()[source]¶ Deletes all reactions on a message. This endpoint requires the ‘MANAGE_MESSAGES’ permission to be present on the current user.
-
await
delete_user_reaction
(user_id, emoji_id)[source]¶ Deletes another user’s reaction. This endpoint requires the ‘MANAGE_MESSAGES’ permission to be present on the current user.
-
-
class
discordaio.channel.
Overwrite
(id=None, type=None, allow=None, deny=None)[source]¶ Represents a Overwrite object.
New in version 0.2.0.
Inheritance
-
class
discordaio.channel.
MessageActivity
(type: int = None, party_id: int = None)[source]¶ Represents a Message Activity.
New in version 0.2.0.
-
type
¶ type of message activity
-
party_id
¶ party_id from a Rich Presence event
Inheritance
-
-
class
discordaio.channel.
MessageApplication
(id=None, cover_image=None, description=None, icon=None, name=None)[source]¶ Represents a Message Application.
New in version 0.2.0.
Inheritance
-
class
discordaio.channel.
Reaction
(count: int = None, me: bool = False, emoji: discordaio.emoji.Emoji = None)[source]¶ Represents a Reaction.
New in version 0.2.0.
-
count
¶ times this emoji has been used to react
-
me
¶ whether the current user reacted using this emoji
-
emoji emoji information
Inheritance
-
-
class
discordaio.channel.
Embed
(title=None, type=None, description=None, url=None, timestamp=None, color=None, footer=<discordaio.channel.EmbedFooter object>, image=<discordaio.channel.EmbedImage object>, thumbnail=<discordaio.channel.EmbedThumbnail object>, video=<discordaio.channel.EmbedVideo object>, provider=<discordaio.channel.EmbedProvider object>, author=<discordaio.channel.EmbedAuthor object>, fields=[])[source]¶ Represents a discord Embed
New in version 0.2.0.
footer information
Type: EmbedFooter
-
image
¶ image information
Type: EmbedImage
-
thumbnail
¶ thumbnail information
Type: EmbedThumbnail
-
video
¶ video information
Type: EmbedVideo
-
provider
¶ provider information
Type: EmbedProvider
author information
Type: EmbedAuthor
-
fields
¶ fields information
Type: list
ofEmbedField
Inheritance
-
class
discordaio.channel.
EmbedThumbnail
(url=None, proxy_url=None, height=None, width=None)[source]¶ Represents a embed thumbnail object
New in version 0.2.0.
Inheritance
-
class
discordaio.channel.
EmbedVideo
(url=None, height=None, width=None)[source]¶ Represents a embed video
New in version 0.2.0.
Inheritance
-
class
discordaio.channel.
EmbedImage
(url=None, proxy_url=None, height=None, width=None)[source]¶ Represents a embed image
New in version 0.2.0.
Inheritance
-
class
discordaio.channel.
EmbedProvider
(name=None, url=None)[source]¶ Represents a embed provider
New in version 0.2.0.
Inheritance
-
class
discordaio.channel.
EmbedAuthor
(name=None, url=None, icon_url=None, proxy_icon_url=None)[source]¶ Represents a embed author
New in version 0.2.0.
Inheritance
Represents a embed footer
New in version 0.2.0.
footer text
Type: str
url of footer icon (only supports http(s) and attachments)
Type: str
a proxied url of footer icon
Type: str
Inheritance
-
class
discordaio.channel.
EmbedField
(name=None, value=None, inline=False)[source]¶ Represents a embed field
New in version 0.2.0.
Inheritance