discordaio.guild

Classes

class discordaio.guild.Guild(id=0, name='', icon='', splash='', owner=False, owner_id=0, permissions=0, region='', afk_channel_id=0, afk_timeout=0, embed_enabled=False, embed_channel_id=0, verification_level=0, default_message_notifications=0, explicit_content_filter=0, roles=[], emojis=[], features=[], mfa_level=0, application_id=0, widget_enabled=False, widget_channel_id=0, system_channel_id=0, joined_at=None, large=None, unavailable=None, member_count=None, voice_states=None, members=[], channels=None, presences=None)[source]

Represents a guild

New in version 0.2.0.

Note

Guilds in Discord represent an isolated collection of users and channels, and are often referred to as “servers” in the UI.

id

guild id

Type:int
name

guild name (2-100 characters)

Type:str
icon

icon hash

Type:str
splash

splash hash

Type:str
owner

whether or not the user is the owner of the guild

Type:bool, optional
owner_id

id of owner

Type:int
permissions

total permissions for the user in the guild (does not include channel overrides)

Type:int, optional
region

voice region id for the guild

Type:str
afk_channel_id

id of afk channel

Type:int
afk_timeout

afk timeout in seconds

Type:int
embed_enabled

is this guild embeddable (e.g. widget)

Type:bool, optional
embed_channel_id

id of embedded channel

Type:int, optional
verification_level

verification level required for the guild

Type:int
default_message_notifications

default message notifications level

Type:int
explicit_content_filter

explicit content filter level

Type:int
roles

roles in the guild

Type:list of Role
emojis

custom guild emojis

Type:list of Emoji
features

enabled guild features

Type:list of Strings
mfa_level

required MFA level for the guild

Type:int
application_id

application id of the guild creator if it is bot-created

Type:int
widget_enabled

whether or not the server widget is enabled

Type:bool, optional
widget_channel_id

the channel id for the server widget

Type:int, optional
system_channel_id

the id of the channel to which system messages are sent

Type:int
joined_at

timestamp when this guild was joined at

Type:int, optional
large

whether this is considered a large guild

Type:bool, optional
unavailable

is this guild unavailable

Type:bool, optional
member_count

total number of members in this guild

Type:int, optional
voice_states

(without the guild_id key)

Type:list of Partial
members

users in the guild

Type:list of Guild
channels

channels in the guild

Type:list of Channel
presences

presences of the users in the guild

Type:list of Partial

Inheritance

Inheritance diagram of Guild
await create_channel(channel: discordaio.channel.Channel) → discordaio.channel.Channel[source]

Creates a new guild channel

New in version 0.3.0.

Parameters:channel – The channel to create.
await delete() → None[source]

Deletes the guild

New in version 0.3.0.

Raises:AuthorizationError – Raised if you have no authorization to delete the guild.
await get_channels() → discordaio.channel.Channel[source]

Returns a list of channels withing the guild.

New in version 0.3.0.

get_icon() → str[source]

Returns the guild icon

New in version 0.2.0.

Returns:The icon link
Return type:str
await get_member(member_id: int) → discordaio.guild.GuildMember[source]

Gets a guild member.

New in version 0.3.0.

Parameters:member_id – The member id
await get_members()[source]

Gets and fills the guild with the members info.

New in version 0.3.0.

get_splash()[source]

Returns the guild splash

New in version 0.2.0.

Returns:The splash link
Return type:str
is_owner(member: discordaio.guild.GuildMember) → bool[source]

Returns wether the guild member is the owner of the guild

New in version 0.2.0.

Parameters:member (GuildMember) – The member
Returns:True if it’s the owner, False otherwise.
Return type:bool
await leave()[source]

Leaves a guild.

New in version 0.3.0.

class discordaio.guild.GuildMember(user=<User Object: #, 0>, nick='', roles=[], joined_at=None, deaf=False, mute=False)[source]

Represents a guild member

New in version 0.2.0.

user

user object

Type:User
nick

this users guild nickname (if one is set)

Type:str, optional
roles

array of role object ids

Type:list of int
joined_at

timestamp when the user joined the guild

Type:int
deaf

if the user is deafened

Type:bool
mute

if the user is muted

Type:bool

Inheritance

Inheritance diagram of GuildMember
class discordaio.guild.GuildEmbed(enabled=False, channel_id=0)[source]

Represents a guild embed

New in version 0.2.0.

enabled

if the embed is enabled

Type:bool
channel_id

the embed channel id

Type:int

Inheritance

Inheritance diagram of GuildEmbed
class discordaio.guild.IntegrationAccount(id='', name='')[source]

Represents a integration account

New in version 0.2.0.

id

id of the account

Type:str
name

name of the account

Type:str

Inheritance

Inheritance diagram of IntegrationAccount
class discordaio.guild.Integration(id=0, name='', type='', enabled=False, syncing=False, role_id=0, expire_behavior=0, expire_grace_period=0, user=None, account=None, synced_at=None)[source]

Represents a integration

New in version 0.2.0.

id

integration id

Type:int
name

integration name

Type:str
type

integration type (twitch, youtube, etc)

Type:str
enabled

is this integration enabled

Type:bool
syncing

is this integration syncing

Type:bool
role_id

id that this integration uses for “subscribers”

Type:int
expire_behavior

the behavior of expiring subscribers

Type:int
expire_grace_period

the grace period before expiring subscribers

Type:int
user

object user for this integration

Type:User
account

account information

Type:Account
synced_at

timestamp when this integration was last synced

Type:int

Inheritance

Inheritance diagram of Integration
class discordaio.guild.Ban(reason='', user=None)[source]

Represents a ban

New in version 0.2.0.

reason

the reason for the ban

Type:str
user

the banned user

Type:User

Inheritance

Inheritance diagram of Ban