disco.types.guild

Constants

VerificationLevel = Enum(
  NONE = 0,
  LOW = 1,
  MEDIUM = 2,
  HIGH = 3,
  EXTREME = 4)
ExplicitContentFilterLevel = Enum(
  NONE = 0,
  WITHOUT_ROLES = 1,
  ALL = 2)
DefaultMessageNotificationsLevel = Enum(
  ALL_MESSAGES = 0,
  ONLY_MENTIONS = 1)
AuditLogActionTypes = Enum(
  GUILD_UPDATE = 1,
  CHANNEL_CREATE = 10,
  CHANNEL_UPDATE = 11,
  CHANNEL_DELETE = 12,
  CHANNEL_OVERWRITE_CREATE = 13,
  CHANNEL_OVERWRITE_UPDATE = 14,
  CHANNEL_OVERWRITE_DELETE = 15,
  MEMBER_KICK = 20,
  MEMBER_PRUNE = 21,
  MEMBER_BAN_ADD = 22,
  MEMBER_BAN_REMOVE = 23,
  MEMBER_UPDATE = 24,
  MEMBER_ROLE_UPDATE = 25,
  ROLE_CREATE = 30,
  ROLE_UPDATE = 31,
  ROLE_DELETE = 32,
  INVITE_CREATE = 40,
  INVITE_UPDATE = 41,
  INVITE_DELETE = 42,
  WEBHOOK_CREATE = 50,
  WEBHOOK_UPDATE = 51,
  WEBHOOK_DELETE = 52,
  EMOJI_CREATE = 60,
  EMOJI_UPDATE = 61,
  EMOJI_DELETE = 62,
  MESSAGE_DELETE = 72)

{'type': 'assign', 'targets': ['GUILD_ACTIONS'], 'value': {'elts': [{'type': 'attribute', 'name': 'GUILD_UPDATE', 'value': 'AuditLogActionTypes'}], 'type': 'tuple'}}

{'type': 'assign', 'targets': ['CHANNEL_ACTIONS'], 'value': {'elts': [{'type': 'attribute', 'name': 'CHANNEL_CREATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'CHANNEL_UPDATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'CHANNEL_DELETE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'CHANNEL_OVERWRITE_CREATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'CHANNEL_OVERWRITE_UPDATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'CHANNEL_OVERWRITE_DELETE', 'value': 'AuditLogActionTypes'}], 'type': 'tuple'}}

{'type': 'assign', 'targets': ['MEMBER_ACTIONS'], 'value': {'elts': [{'type': 'attribute', 'name': 'MEMBER_KICK', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'MEMBER_PRUNE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'MEMBER_BAN_ADD', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'MEMBER_BAN_REMOVE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'MEMBER_UPDATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'MEMBER_ROLE_UPDATE', 'value': 'AuditLogActionTypes'}], 'type': 'tuple'}}

{'type': 'assign', 'targets': ['ROLE_ACTIONS'], 'value': {'elts': [{'type': 'attribute', 'name': 'ROLE_CREATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'ROLE_UPDATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'ROLE_DELETE', 'value': 'AuditLogActionTypes'}], 'type': 'tuple'}}

{'type': 'assign', 'targets': ['INVITE_ACTIONS'], 'value': {'elts': [{'type': 'attribute', 'name': 'INVITE_CREATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'INVITE_UPDATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'INVITE_DELETE', 'value': 'AuditLogActionTypes'}], 'type': 'tuple'}}

{'type': 'assign', 'targets': ['WEBHOOK_ACTIONS'], 'value': {'elts': [{'type': 'attribute', 'name': 'WEBHOOK_CREATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'WEBHOOK_UPDATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'WEBHOOK_DELETE', 'value': 'AuditLogActionTypes'}], 'type': 'tuple'}}

{'type': 'assign', 'targets': ['EMOJI_ACTIONS'], 'value': {'elts': [{'type': 'attribute', 'name': 'EMOJI_CREATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'EMOJI_UPDATE', 'value': 'AuditLogActionTypes'}, {'type': 'attribute', 'name': 'EMOJI_DELETE', 'value': 'AuditLogActionTypes'}], 'type': 'tuple'}}

{'type': 'assign', 'targets': ['MESSAGE_ACTIONS'], 'value': {'elts': [{'type': 'attribute', 'name': 'MESSAGE_DELETE', 'value': 'AuditLogActionTypes'}], 'type': 'tuple'}}

Classes

GuildEmoji

Inherits From Emoji

An emoji object.

Attributes
Name Type Description
id snowflake The ID of this emoji.
name str The name of this emoji.
require_colons bool Whether this emoji requires colons to use.
managed bool Whether this emoji is managed by an integration.
roles list(snowflake) Roles this emoji is attached to.
animated bool Whether this emoji is animated.

Functions

str(self)

update(self,**kwargs)

delete(self,**kwargs)

url(self)

guild(self)

Role

Inherits From SlottedModel

A role object.

Attributes
Name Type Description
id snowflake The role ID.
name string The role name.
hoist bool Whether this role is hoisted (displayed separately in the sidebar).
managed bool Whether this role is managed by an integration.
color int The RGB color of this role.
permissions :class:`disco.types.permissions.PermissionsValue` The permissions this role grants.
position int The position of this role in the hierarchy.

Functions

str(self)

delete(self,**kwargs)

update(self,*args,**kwargs)

mention(self)

guild(self)

GuildBan

Inherits From SlottedModel

GuildMember

Inherits From SlottedModel

A GuildMember object.

Attributes
Name Type Description
user :class:`disco.types.user.User` The user object of this member.
guild_id snowflake The guild this member is part of.
nick str The nickname of the member.
mute bool Whether this member is server voice-muted.
deaf bool Whether this member is server voice-deafened.
joined_at datetime When this user joined the guild.
roles list(snowflake) Roles this member is part of.

Functions

str(self)

name(self)

The nickname of this user if set, otherwise their username

get_voice_state(self)

Returns
Returns the voice state for the member if they are currently connected
to the guild's voice server.

kick(self,**kwargs)

Kicks the member from the guild.

ban(self, delete_message_days,**kwargs)

Bans the member from the guild.

Args
Name Type Description
delete_message_days int The number of days to retroactively delete messages for.

unban(self,**kwargs)

Unbans the member from the guild.

set_nickname(self, nickname,**kwargs)

Sets the member's nickname (or clears it if None).

Args
Name Type Description
nickname Optional[str] The nickname (or none to reset) to set.

modify(self,**kwargs)

add_role(self, role,**kwargs)

remove_role(self, role,**kwargs)

owner(self)

mention(self)

id(self)

Alias to the guild members user id.

guild(self)

permissions(self)

Guild

Inherits From SlottedModel, Permissible

A guild object.

Attributes
Name Type Description
id snowflake The id of this guild.
owner_id snowflake The id of the owner.
afk_channel_id snowflake The id of the afk channel.
embed_channel_id snowflake The id of the embed channel.
system_channel_id snowflake The id of the system channel.
name str Guild's name.
icon str Guild's icon hash
splash str Guild's splash image hash
region str Voice region.
afk_timeout int Delay after which users are automatically moved to the afk channel.
embed_enabled bool Whether the guild's embed is enabled.
verification_level int The verification level used by the guild.
mfa_level int The MFA level used by the guild.
features list(str) Extra features enabled for this guild.
members dict(snowflake, :class:`GuildMember`) All of the guild's members.
channels dict(snowflake, :class:`disco.types.channel.Channel`) All of the guild's channels.
roles dict(snowflake, :class:`Role`) All of the guild's roles.
emojis dict(snowflake, :class:`GuildEmoji`) All of the guild's emojis.
voice_states dict(str, :class:`disco.types.voice.VoiceState`) All of the guild's voice states.

Functions

init(self,*args,**kwargs)

owner(self)

get_permissions(self, member)

Get the permissions a user has in this guild.

Returns
Computed permission value for the user.

get_voice_state(self, user)

Attempt to get a voice state for a given user (who should be a member of this guild).

Returns
The voice state for the user in this guild.

get_member(self, user)

Attempt to get a member from a given user.

Returns
The guild member object for the given user.

create_role(self,**kwargs)

Create a new role.

Returns
The newly created role.

delete_role(self, role,**kwargs)

Delete a role.

update_role(self, role,**kwargs)

sync(self)

get_bans(self)

delete_ban(self, user,**kwargs)

create_ban(self, user,*args,**kwargs)

create_channel(self,*args,**kwargs)

create_category(self, name, permission_overwrites, position=None, reason=None)

Creates a category within the guild.

create_text_channel(self, name, permission_overwrites, parent_id=None, nsfw=None, position=None, reason=None)

Creates a text channel within the guild.

create_voice_channel(self, name, permission_overwrites, parent_id=None, bitrate=None, user_limit=None, position=None, reason=None)

Creates a voice channel within the guild.

leave(self)

get_invites(self)

get_emojis(self)

get_icon_url(self, fmt, size=1024)

get_splash_url(self, fmt, size=1024)

icon_url(self)

splash_url(self)

system_channel(self)

audit_log(self)

audit_log_iter(self,**kwargs)

get_audit_log_entries(self,*args,**kwargs)

AuditLogObjectChange

Inherits From SlottedModel

AuditLogEntry

Inherits From SlottedModel

Functions

create(cls, client, users, webhooks, data,**kwargs)

guild(self)

user(self)

target(self)

results matching ""

    No results matching ""