discordaio.channel

Contains all related Channel Discord objects

Classes

class discordaio.channel.Channel(id=0, type=0, guild_id=0, position=0, permission_overwrites=[], name='', topic='', nsfw=False, last_message_id=0, bitrate=0, user_limit=0, recipients=[], icon='', owner_id=0, application_id=0, parent_id=0, last_pin_timestamp=None)[source]

Represents a guild or DM channel within Discord.

New in version 0.2.0.

id

int – the id of this channel

value_type

int – the value_type of channel

guild_id

int, optional – the id of the guild

position

int, optional – sorting position of the channel

permission_overwrites

list of Overwrite, optional – explicit permission overwrites for members and roles

name

str, optional – the name of the channel (2-100 characters)

topic

str, optional – the channel topic (0-1024 characters)

nsfw

bool, optional – if the channel is nsfw

last_message_id

int, optional – the id of the last message sent in this channel (may not point to an existing or valid message)

bitrate

int, optional – the bitrate (in bits) of the voice channel

user_limit

int, optional – the user limit of the voice channel

recipients

list of User, optional – the recipients of the DM

icon

str, optional – icon hash

owner_id

int, optional – id of the DM creator

application_id

int, optional – application id of the group DM creator if it is bot-created

parent_id

int, optional – id of the parent category for a channel

last_pin_timestamp

int, optional – timestamp when the last pinned message was pinned

Inheritance

Inheritance diagram of Channel
class discordaio.channel.ChannelMessage(id=0, channel_id=0, author=None, content='', timestamp=None, edited_timestamp=None, tts=False, mention_everyone=False, mentions=[], mention_roles=[], attachments=[], embeds=[], reactions=[], nonce=0, pinned=False, webhook_id=0, type=0, 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 a Webhook, 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

int – id of the message

channel_id

int – id of the channel the message was sent in

author

user – object the author of this message (not guaranteed to be a valid user, see below)

content

str – contents of the message

timestamp

int – timestamp when this message was sent

edited_timestamp

int – timestamp when this message was edited (or null if never)

tts

bool – whether this was a TTS message

mention_everyone

bool – whether this message mentions everyone

mentions

list of User – objects users specifically mentioned in the message

mention_roles

list of Role – object ids roles specifically mentioned in this message

attachments

list of Attachment – objects any attached files

embeds

list of Embed – objects any embedded content

reactions

list of Reaction – objects reactions to the message

nonce

int, optional – used for validating a message was sent

pinned

bool – whether this message is pinned

webhook_id

int, optional – if the message is generated by a webhook, this is the webhook’s id

type

int – type of message

activity

MessageActivity – activity object sent with Rich Presence-related chat embeds

application

MessageApplication – application object sent with Rich Presence-related chat embeds

Inheritance

Inheritance diagram of ChannelMessage
class discordaio.channel.Overwrite(id=0, type='', allow=0, deny=0)[source]

Represents a Overwrite object.

New in version 0.2.0.

id

int – role or user id

type

str – either “role” or “member”

allow

int – permission bit set

deny

int – permission bit set

Inheritance

Inheritance diagram of Overwrite
class discordaio.channel.MessageActivity(type=None, party_id='')[source]

Represents a Message Activity.

New in version 0.2.0.

type

int – type of message activity

party_id

str, optional – party_id from a Rich Presence event

Inheritance

Inheritance diagram of MessageActivity
class discordaio.channel.MessageApplication(id=0, cover_image='', description='', icon='', name='')[source]

Represents a Message Application.

New in version 0.2.0.

id

int – id of the application

cover_image

str – id of the embed’s image asset

description

str – application’s description

icon

str – id of the application’s icon

name

str – name of the application

Inheritance

Inheritance diagram of MessageApplication
class discordaio.channel.Reaction(count=0, me=False, emoji=None)[source]

Represents a Reaction.

New in version 0.2.0.

count

int – times this emoji has been used to react

me

bool – whether the current user reacted using this emoji

emoji

Emoji – emoji information

Inheritance

Inheritance diagram of Reaction
class discordaio.channel.Embed(title='', type='', description='', url='', timestamp=None, color=0, 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.

title

str – title of embed

type

str – type of embed (always “rich” for webhook embeds)

description

str – description of embed

url

str – url of embed

timestamp

int – timestamp of embed content

color

int – color code of the embed

footer

EmbedFooter – footer information

image

EmbedImage – image information

thumbnail

EmbedThumbnail – thumbnail information

video

EmbedVideo – video information

provider

EmbedProvider – provider information

author

EmbedAuthor – author information

fields

list of EmbedField – fields information

Inheritance

Inheritance diagram of Embed
class discordaio.channel.EmbedThumbnail(url='', proxy_url='', height=0, width=0)[source]

Represents a embed thumbnail object

New in version 0.2.0.

url

str – source url of thumbnail (only supports http(s) and attachments)

proxy_url

str – a proxied url of the thumbnail

height

int – height of thumbnail

width

int – width of thumbnail

Inheritance

Inheritance diagram of EmbedThumbnail
class discordaio.channel.EmbedVideo(url='', height=0, width=0)[source]

Represents a embed video

New in version 0.2.0.

url

str – source url of video

height

int – height of video

width

int – width of video

Inheritance

Inheritance diagram of EmbedVideo
class discordaio.channel.EmbedImage(url='', proxy_url='', height=0, width=0)[source]

Represents a embed image

New in version 0.2.0.

url

str – source url of image (only supports http(s) and attachments)

proxy_url

str – a proxied url of the image

height

int – height of image

width

int – width of image

Inheritance

Inheritance diagram of EmbedImage
class discordaio.channel.EmbedProvider(name='', url='')[source]

Represents a embed provider

New in version 0.2.0.

name

str – name of provider

url

str – url of provider

Inheritance

Inheritance diagram of EmbedProvider
class discordaio.channel.EmbedAuthor(name='', url='', icon_url='', proxy_icon_url='')[source]

Represents a embed author

New in version 0.2.0.

name

str – name of author

url

str – url of author

icon_url

str – url of author icon (only supports http(s) and attachments)

proxy_icon_url

str – a proxied url of author icon

Inheritance

Inheritance diagram of EmbedAuthor
class discordaio.channel.EmbedFooter(text='', icon_url='', proxy_icon_url='')[source]

Represents a embed footer

New in version 0.2.0.

text

str – footer text

icon_url

str – url of footer icon (only supports http(s) and attachments)

proxy_icon_url

str – a proxied url of footer icon

Inheritance

Inheritance diagram of EmbedFooter
class discordaio.channel.EmbedField(name='', value='', inline=False)[source]

Represents a embed field

New in version 0.2.0.

name

str – name of the field

value

str – value of the field

inline

bool – whether or not this field should display inline

Inheritance

Inheritance diagram of EmbedField
class discordaio.channel.Attachment(id=0, filename='', size=0, url='', proxy_url='', height=0, width=0)[source]

Represents a attachment

New in version 0.2.0.

id

int – attachment id

filename

str – name of file attached

size

int – size of file in bytes

url

str – source url of file

proxy_url

str – a proxied url of file

height

int – height of file (if image)

width

int – width of file (if image)

Inheritance

Inheritance diagram of Attachment