Guild Models#

enum interactions.api.models.guild.VerificationLevel(value)[source]#

An enumerable object representing the verification level of a guild.

Member Type:

int

Valid values are as follows:

NONE = <VerificationLevel.NONE: 0>#
LOW = <VerificationLevel.LOW: 1>#
MEDIUM = <VerificationLevel.MEDIUM: 2>#
HIGH = <VerificationLevel.HIGH: 3>#
VERY_HIGH = <VerificationLevel.VERY_HIGH: 4>#
enum interactions.api.models.guild.EntityType(value)[source]#

An enumerable object representing the type of event.

Member Type:

int

Valid values are as follows:

STAGE_INSTANCE = <EntityType.STAGE_INSTANCE: 1>#
VOICE = <EntityType.VOICE: 2>#
EXTERNAL = <EntityType.EXTERNAL: 3>#
enum interactions.api.models.guild.DefaultMessageNotificationLevel(value)[source]#

An enumerable object representing the default message notification level of a guild.

Member Type:

int

Valid values are as follows:

ALL_MESSAGES = <DefaultMessageNotificationLevel.ALL_MESSAGES: 0>#
ONLY_MENTIONS = <DefaultMessageNotificationLevel.ONLY_MENTIONS: 1>#
class interactions.api.models.guild.EventMetadata(kwargs_dict=None, /, **other_kwargs)[source]#

A class object representing the metadata of an event entity.

Variables:

location (Optional[str]) – The location of the event, if any.

enum interactions.api.models.guild.EventStatus(value)[source]#

An enumerable object representing the status of an event.

Member Type:

int

Valid values are as follows:

SCHEDULED = <EventStatus.SCHEDULED: 1>#
ACTIVE = <EventStatus.ACTIVE: 2>#
COMPLETED = <EventStatus.COMPLETED: 3>#
CANCELED = <EventStatus.CANCELED: 4>#
class interactions.api.models.guild.GuildTemplate(kwargs_dict=None, /, **other_kwargs)[source]#

An object representing the snapshot of an existing guild.

Variables:
  • code (str) – The code of the guild template.

  • name (str) – The name of the guild template.

  • description (Optional[str]) – The description of the guild template, if given.

  • usage_count (int) – The amount of uses on the template.

  • creator_id (Snowflake) – User ID of the creator of this template.

  • creator (User) – The User object of the creator of this template.

  • created_at (datetime) – The time when this template was created.

  • update_at (datetime) – The time when this template was updated.

  • source_guild_id (Snowflake) – The Guild ID that the template sourced from.

  • serialized_source_guild (Guild) – A partial Guild object from the sourced template.

  • is_dirty (Optional[bool]) – A status that denotes if the changes are unsynced.

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

A class object representing an integration in a guild.

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

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

  • type (str) – The type of integration.

  • enabled (bool) – Whether the integration is enabled or not.

  • syncing (bool) – Whether the integration is syncing or not.

  • role_id (Snowflake) – The role ID that the integration uses for « subscribed » users.

  • enable_emoticons (bool) – Whether emoticons should be enabled or not.

  • expire_behavior (int) – The expiration behavior of the integration.

  • expire_grace_period (int) – The « grace period » of the integration when expired – how long it can still be used.

  • user (User) – The user of the integration.

  • account (Any) – The account of the integration.

  • synced_at (datetime) – The time that the integration was last synced.

  • subscriber_count (int) – The current subscriber count of the integration.

  • revoked (bool) – Whether the integration was revoked for use or not.

  • application (Application) – The application used for the integration.

enum interactions.api.models.guild.InviteTargetType(value)[source]#

An enumerable object representing the different invite target types

Member Type:

int

Valid values are as follows:

STREAM = <InviteTargetType.STREAM: 1>#
EMBEDDED_APPLICATION = <InviteTargetType.EMBEDDED_APPLICATION: 2>#
class interactions.api.models.guild.StageInstance(kwargs_dict=None, /, **other_kwargs)[source]#

A class object representing an instance of a stage channel in a guild.

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

  • guild_id (Snowflake) – The guild ID the stage is in.

  • channel_id (Snowflake) – The channel ID the stage is instantiated from.

  • topic (str) – The topic of the stage.

  • privacy_level (int) – The « privacy »/inclusive accessibility level of the stage.

  • discoverable_disabled (bool) – Whether the stage can be seen from the stage discovery.

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

A class object representing how a guild that is unavailable.

Note

This object only seems to show up during the connection process of the client to the Gateway when the READY event is dispatched. This event will pass fields with guilds where this becomes present.

Variables:
  • id (Snowflake) – The ID of the unavailable guild.

  • unavailable (bool) – Whether the guild is unavailable or not.

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

A class object representing a welcome channel on the welcome screen.

Note

emoji_id and emoji_name are given values respectively if the welcome channel uses an emoji.

Variables:
  • channel_id (Snowflake) – The ID of the welcome channel.

  • description (str) – The description of the welcome channel.

  • emoji_id (Optional[Snowflake]) – The ID of the emoji of the welcome channel.

  • emoji_name (Optional[str]) – The name of the emoji of the welcome channel.

enum interactions.api.models.guild.ExplicitContentFilterLevel(value)[source]#

An enumerable object representing the explicit content filter level of a guild.

Member Type:

int

Valid values are as follows:

DISABLED = <ExplicitContentFilterLevel.DISABLED: 0>#
MEMBERS_WITHOUT_ROLES = <ExplicitContentFilterLevel.MEMBERS_WITHOUT_ROLES: 1>#
ALL_MEMBERS = <ExplicitContentFilterLevel.ALL_MEMBERS: 2>#
class interactions.api.models.guild.ScheduledEvents(kwargs_dict=None, /, **other_kwargs)[source]#

A class object representing the scheduled events of a guild.

Variables:
  • id (Snowflake) – The ID of the scheduled event.

  • guild_id (Snowflake) – The ID of the guild that this scheduled event belongs to.

  • channel_id (Optional[Snowflake]) – The channel ID in which the scheduled event belongs to, if any.

  • creator_id (Optional[Snowflake]) – The ID of the user that created the scheduled event.

  • name (str) – The name of the scheduled event.

  • description (str) – The description of the scheduled event.

  • scheduled_start_time (datetime) – The scheduled event start time.

  • scheduled_end_time (Optional[datetime]) – The scheduled event end time, if any.

  • privacy_level (int) – The privacy level of the scheduled event.

  • entity_type (int) – The type of the scheduled event.

  • entity_id (Optional[Snowflake]) – The ID of the entity associated with the scheduled event.

  • entity_metadata (Optional[EventMetadata]) – Additional metadata associated with the scheduled event.

  • creator (Optional[User]) – The user that created the scheduled event.

  • user_count (Optional[int]) – The number of users subscribed to the scheduled event.

  • status (int) – The status of the scheduled event

  • image (Optional[str]) – The hash containing the image of an event, if applicable.

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

A class object representing the welcome screen shown for community guilds.

Variables:
  • description (Optional[str]) – The description of the welcome screen.

  • welcome_channels (List[WelcomeChannels]) – A list of welcome channels of the welcome screen.

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

A class object representing how a guild is registered.

Note

Most of these optionals are actually declared with their value upon instantiation but are kept like this since this class object is meant to be more broad and generalized.

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

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

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

  • icon_hash (Optional[str]) – The hashed version of the icon of the guild.

  • splash (Optional[str]) – The invite splash banner of the guild.

  • discovery_splash (Optional[str]) – The discovery splash banner of the guild.

  • owner (Optional[bool]) – Whether the guild is owned.

  • owner_id (Snowflake) – The ID of the owner of the guild.

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

  • region (Optional[str]) – The geographical region of the guild.

  • afk_channel_id (Optional[Snowflake]) – The AFK voice channel of the guild.

  • afk_timeout (int) – The timeout of the AFK voice channel of the guild.

  • widget_enabled (Optional[bool]) – Whether widgets are enabled in the guild.

  • widget_channel_id (Optional[Snowflake]) – The channel ID of the widget in the guild.

  • verification_level (int) – The level of user verification of the guild.

  • default_message_notifications (int) – The default message notifications setting of the guild.

  • explicit_content_filter (int) – The explicit content filter setting level of the guild.

  • roles (List[Role]) – The list of roles in the guild.

  • emojis (List[Emoji]) – The list of emojis from the guild.

  • features (List[GuildFeature]) – The list of features of the guild.

  • mfa_level (int) – The MFA level of the guild.

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

  • system_channel_id (Optional[Snowflake]) – The channel ID of the system of the guild.

  • rules_channel_id (Optional[Snowflake]) – The channel ID of Discord’s defined « rules » channel of the guild.

  • joined_at (Optional[datetime]) – The timestamp the member joined the guild.

  • large (Optional[bool]) – Whether the guild is considered « large. »

  • unavailable (Optional[bool]) – Whether the guild is unavailable to access.

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

  • members (Optional[List[Member]]) – The members in the guild.

  • channels (Optional[List[Channel]]) – The channels in the guild.

  • threads (Optional[List[Thread]]) – All known threads in the guild.

  • presences (Optional[List[PresenceUpdate]]) – The list of presences in the guild.

  • max_presences (Optional[int]) – The maximum amount of presences allowed in the guild.

  • max_members (Optional[int]) – The maximum amount of members allowed in the guild.

  • vanity_url_code (Optional[str]) – The vanity URL of the guild.

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

  • banner (Optional[str]) – The banner of the guild.

  • premium_tier (int) – The server boost level of the guild.

  • premium_subscription_count (Optional[int]) – The amount of server boosters in the guild.

  • preferred_locale (str) – The « preferred » local region of the guild.

  • public_updates_channel_id (Optional[Snowflake]) – The channel ID for community updates of the guild.

  • max_video_channel_users (Optional[int]) – The maximum amount of video streaming members in a channel allowed in a guild.

  • approximate_member_count (Optional[int]) – The approximate amount of members in the guild.

  • approximate_presence_count (Optional[int]) – The approximate amount of presences in the guild.

  • welcome_screen (Optional[WelcomeScreen]) – The welcome screen of the guild.

  • nsfw_level (int) – The NSFW safety filter level of the guild.

  • stage_instances (Optional[List[StageInstance]]) – The stage instance of the guild.

  • stickers (Optional[List[Sticker]]) – The list of stickers from the guild.

  • premium_progress_bar_enabled (Optional[bool]) – Whether the guild has the boost progress bar enabled.

property voice_states: List[VoiceState]#

Nouveau dans la version 4.4.0.

Gets all voice states of the guild.

Type renvoyé:

List[VoiceState]

property mapped_voice_states: Dict[int, List[VoiceState]]#

Nouveau dans la version 4.4.0.

Returns all the voice states mapped after their channel id.

Type renvoyé:

Dict[int, List[VoiceState]]

property created_at: datetime#

Nouveau dans la version 4.4.0.

Returns when the guild was created.

async ban(member_id, seconds=0, minutes=<interactions.MISSING>, hours=<interactions.MISSING>, days=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.0.2.

Modifié dans la version 4.3.2: Method has been aligned to changes in the Discord API. You can now input days, hours, minutes and seconds, as long as it doesn’t exceed 604800 seconds in total for deleting messages, instead of only days.

Bans a member from the guild.

Paramètres:
  • member_id (Union[int, Member, Snowflake]) – The id of the member to ban

  • seconds (Optional[int]) – Number of seconds to delete messages, from 0 to 604800. Defaults to 0

  • minutes (Optional[int]) – Number of minutes to delete messages, from 0 to 10080

  • hours (Optional[int]) – Number of hours to delete messages, from 0 to 168

  • days (Optional[int]) – Number of days to delete messages, from 0 to 7

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

async remove_ban(user_id, reason=None)[source]#

Nouveau dans la version 4.0.2.

Removes the ban of a user.

Paramètres:
  • user_id (Union[int, Snowflake]) – The id of the user to remove the ban from

  • reason (Optional[str]) – The reason for the removal of the ban

async kick(member_id, reason=None)[source]#

Nouveau dans la version 4.0.2.

Kicks a member from the guild.

Paramètres:
  • member_id (Union[int, Member, Snowflake]) – The id of the member to kick

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

async add_member_role(role, member_id, reason=None)[source]#

Nouveau dans la version 4.0.2.

This method adds a role to a member.

Paramètres:
  • role (Union[Role, int, Snowflake]) – The role to add. Either Role object or role_id

  • member_id (Union[Member, int, Snowflake]) – The id of the member to add the roles to

  • reason (Optional[str]) – The reason why the roles are added

async remove_member_role(role, member_id, reason=None)[source]#

Nouveau dans la version 4.0.2.

This method removes a or multiple role(s) from a member.

Paramètres:
  • role (Union[Role, int, Snowflake]) – The role to remove. Either Role object or role_id

  • member_id (Union[Member, int, Snowflake]) – The id of the member to remove the roles from

  • reason (Optional[str]) – The reason why the roles are removed

async create_role(name, permissions=<interactions.MISSING>, color=0, hoist=False, icon=<interactions.MISSING>, unicode_emoji=<interactions.MISSING>, mentionable=False, reason=None)[source]#

Nouveau dans la version 4.0.2.

Creates a new role in the guild.

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

  • color (Optional[int]) – RGB color value as integer, default 0

  • permissions (Optional[Union[Permissions, int]]) – Bitwise value of the enabled/disabled permissions

  • hoist (Optional[bool]) – Whether the role should be displayed separately in the sidebar, default False

  • icon (Optional[Image]) – The role’s icon image (if the guild has the ROLE_ICONS feature)

  • unicode_emoji (Optional[str]) – The role’s unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature)

  • mentionable (Optional[bool]) – Whether the role should be mentionable, default False

  • reason (Optional[str]) – The reason why the role is created, default None

Renvoie:

The created Role

Type renvoyé:

Role

async get_member(member_id)[source]#

Nouveau dans la version 4.0.2.

Searches for the member with specified id in the guild and returns the member as member object.

Paramètres:

member_id (Union[int, Snowflake]) – The id of the member to search for

Renvoie:

The member searched for

Type renvoyé:

Member

async delete_channel(channel_id)[source]#

Nouveau dans la version 4.0.2.

Deletes a channel from the guild.

Paramètres:

channel_id (Union[int, Snowflake, Channel]) – The id of the channel to delete

async delete_role(role_id, reason=None)[source]#

Nouveau dans la version 4.0.2.

Deletes a role from the guild.

Paramètres:
  • role_id (Union[int, Snowflake, Role]) – The id of the role to delete

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

async modify_role(role_id, name=<interactions.MISSING>, permissions=<interactions.MISSING>, color=<interactions.MISSING>, hoist=<interactions.MISSING>, icon=<interactions.MISSING>, unicode_emoji=<interactions.MISSING>, mentionable=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.0.2.

Edits a role in the guild.

Paramètres:
  • role_id (Union[int, Snowflake, Role]) – The id of the role to edit

  • name (Optional[str]) – The name of the role, defaults to the current value of the role

  • color (Optional[int]) – RGB color value as integer, defaults to the current value of the role

  • permissions (Optional[Union[Permissions, int]]) – Bitwise value of the enabled/disabled permissions, defaults to the current value of the role

  • hoist (Optional[bool]) – Whether the role should be displayed separately in the sidebar, defaults to the current value of the role

  • icon (Optional[Image]) – The role’s icon image (if the guild has the ROLE_ICONS feature), defaults to the current value of the role

  • unicode_emoji (Optional[str]) – The role’s unicode emoji as a standard emoji (if the guild has the ROLE_ICONS feature), defaults to the current value of the role

  • mentionable (Optional[bool]) – Whether the role should be mentionable, defaults to the current value of the role

  • reason (Optional[str]) – The reason why the role is edited, default None

Renvoie:

The modified role object

Type renvoyé:

Role

async create_thread(name, channel_id, 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 specified channel.

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

  • channel_id (Union[int, Snowflake, Channel]) – The id of the channel to create the thread in

  • 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

async create_channel(name, type, 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>, reason=None)[source]#

Nouveau dans la version 4.0.2.

Creates a channel in the guild.

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

  • type (ChannelType) – The type of the channel

  • topic (Optional[str]) – The topic of that channel

  • bitrate (Optional[int]) – (voice channel only) The bitrate (in bits) of the voice channel

  • user_limit (Optional[int]) – (voice channel only) Maximum amount of users in the channel

  • rate_limit_per_use (Optional[int]) – Amount of seconds a user has to wait before sending another message (0-21600)

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

  • parent_id (Optional[Union[int, Channel, Snowflake]]) – The id of the parent category for a channel

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

  • nsfw (Optional[bool]) – Whether the channel is nsfw or not, default False

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

Renvoie:

The created channel

Type renvoyé:

Channel

async clone_channel(channel_id)[source]#

Nouveau dans la version 4.3.0.

Clones a channel of the guild.

Paramètres:

channel_id (Union[int, Snowflake, Channel]) – The id of the channel to clone

Renvoie:

The cloned channel

Type renvoyé:

Channel

async modify_channel(channel_id, 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 a channel of the guild.

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

Paramètres:
  • channel_id (Union[int, Snowflake, Channel]) – The id of the channel to modify

  • name (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

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

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

  • archived (Optional[bool]) –

    Nouveau dans la version 4.2.0.

    Whether the thread is archived

  • auto_archive_duration (Optional[Literal[60, 1440, 4320, 10080]]) –

    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

Type renvoyé:

Channel

async modify_member(member_id, nick=<interactions.MISSING>, roles=<interactions.MISSING>, mute=<interactions.MISSING>, deaf=<interactions.MISSING>, channel_id=<interactions.MISSING>, communication_disabled_until=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.0.2.

Modifies a member of the guild.

Paramètres:
  • member_id (Union[int, Snowflake, Member]) – The id of the member to modify

  • nick (Optional[str]) – The nickname of the member

  • roles (Optional[List[int]]) – A list of all role ids the member has

  • mute (Optional[bool]) – whether the user is muted in voice channels

  • deaf (Optional[bool]) – whether the user is deafened in voice channels

  • channel_id (Optional[int]) – id of channel to move user to (if they are connected to voice)

  • communication_disabled_until (Optional[datetime.isoformat]) – when the user’s timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future)

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

Renvoie:

The modified member

Type renvoyé:

Member

async get_preview()[source]#

Nouveau dans la version 4.0.2.

Get the guild’s preview.

Renvoie:

the guild preview as object

Type renvoyé:

GuildPreview

async leave()[source]#

Nouveau dans la version 4.0.2.

Removes the bot from the guild.

async modify(name=<interactions.MISSING>, verification_level=<interactions.MISSING>, default_message_notifications=<interactions.MISSING>, explicit_content_filter=<interactions.MISSING>, afk_channel_id=<interactions.MISSING>, afk_timeout=<interactions.MISSING>, icon=<interactions.MISSING>, owner_id=<interactions.MISSING>, splash=<interactions.MISSING>, discovery_splash=<interactions.MISSING>, banner=<interactions.MISSING>, system_channel_id=<interactions.MISSING>, suppress_join_notifications=<interactions.MISSING>, suppress_premium_subscriptions=<interactions.MISSING>, suppress_guild_reminder_notifications=<interactions.MISSING>, suppress_join_notification_replies=<interactions.MISSING>, rules_channel_id=<interactions.MISSING>, public_updates_channel_id=<interactions.MISSING>, preferred_locale=<interactions.MISSING>, description=<interactions.MISSING>, premium_progress_bar_enabled=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.0.2.

Modifies the current guild.

Paramètres:
  • name (Optional[str]) – The new name of the guild

  • verification_level (Optional[VerificationLevel]) – The verification level of the guild

  • default_message_notifications (Optional[DefaultMessageNotificationLevel]) – The default message notification level for members

  • explicit_content_filter (Optional[ExplicitContentFilterLevel]) – The explicit content filter level for media content

  • afk_channel_id (Optional[int]) – The id for the afk voice channel

  • afk_timeout (Optional[int]) – Afk timeout in seconds

  • icon (Optional[Image]) –

    Nouveau dans la version 4.2.0.

    1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature)

  • owner_id (Optional[int]) – The id of the user to transfer the guild ownership to. You must be the owner to perform this

  • splash (Optional[Image]) –

    Nouveau dans la version 4.2.0.

    16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature)

  • discovery_splash (Optional[Image]) –

    Nouveau dans la version 4.2.0.

    16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature)

  • banner (Optional[Image]) –

    Nouveau dans la version 4.2.0.

    16:9 png/jpeg image for the guild banner (when the server has the BANNER feature; can be animated gif when the server has the ANIMATED_BANNER feature)

  • system_channel_id (Optional[int]) – The id of the channel where guild notices such as welcome messages and boost events are posted

  • suppress_join_notifications (Optional[bool]) – Whether to suppress member join notifications in the system channel or not

  • suppress_premium_subscriptions (Optional[bool]) – Whether to suppress server boost notifications in the system channel or not

  • suppress_guild_reminder_notifications (Optional[bool]) – Whether to suppress server setup tips in the system channel or not

  • suppress_join_notification_replies (Optional[bool]) – Whether to hide member join sticker reply buttons in the system channel or not

  • rules_channel_id (Optional[int]) – The id of the channel where guilds display rules and/or guidelines

  • public_updates_channel_id (Optional[int]) – The id of the channel where admins and moderators of community guilds receive notices from Discord

  • preferred_locale (Optional[str]) – The preferred locale of a community guild used in server discovery and notices from Discord; defaults to « en-US »

  • description (Optional[str]) – The description for the guild, if the guild is discoverable

  • premium_progress_bar_enabled (Optional[bool]) – Whether the guild’s boost progress bar is enabled

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

Renvoie:

The modified guild

Type renvoyé:

Guild

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

Nouveau dans la version 4.2.0.

Sets the name of the guild.

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

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

Type renvoyé:

Guild

async set_verification_level(verification_level, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the verification level of the guild.

Paramètres:
  • verification_level (VerificationLevel) – The new verification level of the guild

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

Type renvoyé:

Guild

async set_default_message_notifications(default_message_notifications, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the default message notifications level of the guild.

Paramètres:
  • default_message_notifications (DefaultMessageNotificationLevel) – The new default message notification level of the guild

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

Type renvoyé:

Guild

async set_explicit_content_filter(explicit_content_filter, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the explicit content filter level of the guild.

Paramètres:
  • explicit_content_filter (ExplicitContentFilterLevel) – The new explicit content filter level of the guild

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

Type renvoyé:

Guild

async set_afk_channel(afk_channel_id, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the afk channel of the guild.

Paramètres:
  • afk_channel_id (int) – The new name of the guild

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

Type renvoyé:

Guild

async set_afk_timeout(afk_timeout, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the afk timeout of the guild.

Paramètres:
  • afk_timeout (int) – The new afk timeout of the guild

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

Type renvoyé:

Guild

async set_system_channel(system_channel_id, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the system channel of the guild.

Paramètres:
  • system_channel_id (int) – The new system channel id of the guild

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

Type renvoyé:

Guild

async set_rules_channel(rules_channel_id, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the rules channel of the guild.

Paramètres:
  • rules_channel_id (int) – The new rules channel id of the guild

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

Type renvoyé:

Guild

async set_public_updates_channel(public_updates_channel_id, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the public updates channel of the guild.

Paramètres:
  • public_updates_channel_id (int) – The new public updates channel id of the guild

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

Type renvoyé:

Guild

async set_preferred_locale(preferred_locale, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the preferred locale of the guild.

Paramètres:
  • preferred_locale (str) – The new preferredlocale of the guild

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

Type renvoyé:

Guild

async set_description(description, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the description of the guild.

Paramètres:
  • description (str) – The new description of the guild

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

Type renvoyé:

Guild

async set_premium_progress_bar_enabled(premium_progress_bar_enabled, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the visibility of the premium progress bar of the guild.

Paramètres:
  • premium_progress_bar_enabled (bool) – Whether the bar is enabled or not

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

Type renvoyé:

Guild

async set_icon(icon, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the icon of the guild.

Paramètres:
  • icon (Image) – The new icon of the guild

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

Type renvoyé:

Guild

async set_splash(splash, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the splash of the guild.

Paramètres:
  • splash (Image) – The new splash of the guild

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

Type renvoyé:

Guild

async set_discovery_splash(discovery_splash, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the discovery_splash of the guild.

Paramètres:
  • discovery_splash (Image) – The new discovery_splash of the guild

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

Type renvoyé:

Guild

async set_banner(banner, *, reason=None)[source]#

Nouveau dans la version 4.2.0.

Sets the banner of the guild.

Paramètres:
  • banner (Image) – The new banner of the guild

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

Type renvoyé:

Guild

async create_scheduled_event(name, entity_type, scheduled_start_time, scheduled_end_time=<interactions.MISSING>, entity_metadata=<interactions.MISSING>, channel_id=<interactions.MISSING>, description=<interactions.MISSING>, image=<interactions.MISSING>)[source]#

Nouveau dans la version 4.0.2.

Creates a scheduled event for the guild.

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

  • entity_type (EntityType) – The entity type of the scheduled event

  • scheduled_start_time (datetime.isoformat) – The time to schedule the scheduled event

  • scheduled_end_time (Optional[datetime.isoformat]) – The time when the scheduled event is scheduled to end

  • entity_metadata (Optional[EventMetadata]) – The entity metadata of the scheduled event

  • channel_id (Optional[int]) – The channel id of the scheduled event.

  • description (Optional[str]) – The description of the scheduled event

  • image (Optional[Image]) – The cover image of the scheduled event

Renvoie:

The created event

Type renvoyé:

ScheduledEvents

async get_scheduled_events(with_user_count)[source]#

Nouveau dans la version 4.3.2.

Gets all scheduled events of the guild.

Paramètres:

with_user_count (bool) – A boolean to include number of users subscribed to the associated event, if given.

Renvoie:

The sheduled events of the guild.

Type renvoyé:

List[ScheduledEvents]

async modify_scheduled_event(event_id, name=<interactions.MISSING>, entity_type=<interactions.MISSING>, scheduled_start_time=<interactions.MISSING>, scheduled_end_time=<interactions.MISSING>, entity_metadata=<interactions.MISSING>, channel_id=<interactions.MISSING>, description=<interactions.MISSING>, status=<interactions.MISSING>, image=<interactions.MISSING>)[source]#

Nouveau dans la version 4.0.2.

Edits a scheduled event of the guild.

Paramètres:
  • event_id (Union[int, ScheduledEvents, Snowflake]) – The id of the event to edit

  • name (Optional[str]) – The name of the event

  • entity_type (Optional[EntityType]) – The entity type of the scheduled event

  • scheduled_start_time (Optional[datetime.isoformat]) – The time to schedule the scheduled event

  • scheduled_end_time (Optional[datetime.isoformat]) – The time when the scheduled event is scheduled to end

  • entity_metadata (Optional[EventMetadata]) – The entity metadata of the scheduled event

  • channel_id (Optional[int]) – The channel id of the scheduled event.

  • description (Optional[str]) – The description of the scheduled event

  • status (Optional[EventStatus]) – The status of the scheduled event

  • image (Optional[Image]) – The cover image of the scheduled event

Renvoie:

The modified event

Type renvoyé:

ScheduledEvents

async delete_scheduled_event(event_id)[source]#

Nouveau dans la version 4.0.2.

Deletes a scheduled event of the guild.

Paramètres:

event_id (Union[int, ScheduledEvents, Snowflake]) – The id of the event to delete

async get_all_channels()[source]#

Nouveau dans la version 4.0.2.

Gets all channels of the guild as list.

Renvoie:

The channels of the guild.

Type renvoyé:

List[Channel]

async get_all_active_threads()[source]#

Nouveau dans la version 4.3.0.

Gets all active threads of the guild.

Renvoie:

The threads of the guild.

Type renvoyé:

List[Thread]

async get_all_roles()[source]#

Nouveau dans la version 4.0.2.

Gets all roles of the guild as list.

Renvoie:

The roles of the guild.

Type renvoyé:

List[Role]

async get_role(role_id)[source]#

Nouveau dans la version 4.2.0.

Gets a role of the guild.

Paramètres:

role_id (int) – The id of the role to get

Renvoie:

The role as object

Type renvoyé:

Role

async modify_role_position(role_id, position, reason=None)[source]#

Nouveau dans la version 4.0.2.

Modifies the position of a role in the guild.

Paramètres:
  • role_id (Union[Role, int]) – The id of the role to modify the position of

  • position (int) – The new position of the role

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

Renvoie:

List of guild roles with updated hierarchy

Type renvoyé:

List[Role]

async modify_role_positions(changes, reason=None)[source]#

Nouveau dans la version 4.2.0.

Modifies the positions of multiple roles in the guild.

Paramètres:
  • changes (List[dict]) – A list of dicts containing roles (id) and their new positions (position)

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

Renvoie:

List of guild roles with updated hierarchy

Type renvoyé:

List[Role]

async get_bans(limit=1000, before=<interactions.MISSING>, after=<interactions.MISSING>)[source]#

Nouveau dans la version 4.0.2.

Modifié dans la version 4.2.0: The method now gets an amount of bans as the endpoint on the Discord API has been paginated. To get all bans use the get_all_bans() method.

Gets a list of banned users.

Paramètres:
  • limit (Optional[int]) – Number of users to return. Defaults to 1000.

  • before (Optional[int]) – Consider only users before the given User ID snowflake.

  • after (Optional[int]) – Consider only users after the given User ID snowflake.

Renvoie:

List of banned users with reasons

Type renvoyé:

List[Dict[str, User]]

async get_all_bans()[source]#

Nouveau dans la version 4.2.0.

Gets all bans of the guild.

Renvoie:

List of banned users with reasons

Type renvoyé:

List[Dict[str, User]]

async prune(days=7, compute_prune_count=True, include_roles=<interactions.MISSING>)[source]#

Nouveau dans la version 4.3.2.

Begins a prune operation.

Paramètres:
  • days (Optional[int]) – Number of days to count, minimum 1, maximum 30. Defaults to 7.

  • compute_prune_count (Optional[bool]) – Whether the returned « pruned » dict contains the computed prune count or None.

  • include_roles (Optional[Union[List[Role], List[int], List[Snowflake], List[str]]]) – Role IDs to include, if given.

Renvoie:

The number of pruned members, if compute_prune_count is not false. Otherwise returns None.

Type renvoyé:

Optional[int]

async get_prune_count(days=7, include_roles=<interactions.MISSING>)[source]#

Nouveau dans la version 4.3.2.

Returns the number of members that would be removed in a prune operation.

Paramètres:
  • days (Optional[int]) – Number of days to count, minimum 1, maximum 30. Defaults to 7.

  • include_roles (Optional[Union[List[Role], List[int], List[Snowflake], List[str]]]) – Role IDs to include, if given.

Renvoie:

The number of members that would be pruned.

Type renvoyé:

int

async get_emoji(emoji_id)[source]#

Nouveau dans la version 4.2.0.

Gets an emoji of the guild and returns it.

Paramètres:

emoji_id (int) – The id of the emoji

Renvoie:

The specified Emoji, if found

Type renvoyé:

Emoji

async get_all_emoji()[source]#

Nouveau dans la version 4.2.0.

Gets all emojis of a guild.

Renvoie:

All emojis of the guild

Type renvoyé:

List[Emoji]

async create_emoji(image, name=<interactions.MISSING>, roles=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.2.0.

Creates an Emoji in the guild.

Paramètres:
  • image (Image) – The image of the emoji.

  • name (Optional[str]) – The name of the emoji. If not specified, the filename will be used

  • roles (Optional[Union[List[Role], List[int]]]) – Roles allowed to use this emoji

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

Type renvoyé:

Emoji

async modify_emoji(emoji_id, name=<interactions.MISSING>, roles=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.4.0.

Edits an Emoji in the guild.

Paramètres:
  • emoji_id (Union[int, Snowflake, Emoji]) – The id of the emoji to edit

  • name (Optional[str]) – The name of the emoji. If not specified, the filename will be used

  • roles (Optional[Union[List[Role], List[int]]]) – Roles allowed to use this emoji

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

Renvoie:

The modified emoji object

Type renvoyé:

Emoji

async delete_emoji(emoji, reason=None)[source]#

Nouveau dans la version 4.2.0.

Deletes an emoji of the guild.

Paramètres:
  • emoji (Union[Emoji, int]) – The emoji or the id of the emoji to delete

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

async get_stickers()[source]#

Nouveau dans la version 4.3.2.

Get the stickers for a guild.

Renvoie:

List of stickers of the guild.

Type renvoyé:

Optional[List[Sticker]]

async get_nitro_sticker_packs()[source]#

Nouveau dans la version 4.3.2.

Gets the list of sticker packs available to Nitro subscribers.

Renvoie:

List of sticker packs.

Type renvoyé:

List[StickerPack]

async create_sticker(file, tags, name=<interactions.MISSING>, description=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.3.2.

Creates a new sticker for the guild.

Paramètres:
  • file (File) – The file of the sticker.

  • tags (str) – The tags of the sticker.

  • name (Optional[str]) – The name of the sticker.

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

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

Renvoie:

Created sticker for the guild.

Type renvoyé:

Sticker

async modify_sticker(sticker_id, name=<interactions.MISSING>, description=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.3.2.

Modifies the sticker of the guild.

Paramètres:
  • sticker_id (Union[Sticker, Snowflake, int]) – The sticker or ID of the sticker.

  • name (Optional[str]) – The name of the sticker.

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

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

Renvoie:

Modified sticker.

Type renvoyé:

Sticker

async delete_sticker(sticker_id, reason=None)[source]#

Nouveau dans la version 4.3.2.

Deletes the sticker of the guild.

Paramètres:
  • sticker_id (Union[Sticker, Snowflake, int]) – The sticker or ID of the sticker.

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

async get_list_of_members(limit=1, after=<interactions.MISSING>)[source]#

Nouveau dans la version 4.2.0.

Lists the members of a guild.

Paramètres:
  • limit (Optional[int]) – How many members to get from the API. Max is 1000.

  • after (Optional[Union[Member, int]]) – Get only Members after this member.

Renvoie:

A list of members

Type renvoyé:

List[Member]

async search_members(query, limit=1)[source]#

Nouveau dans la version 4.2.0.

Search the guild for members whose username or nickname starts with provided string.

Paramètres:
  • query (str) – The string to search for

  • limit (Optional[int]) – The number of members to return.

Renvoie:

A list of matching members

Type renvoyé:

List[Member]

async get_all_members()[source]#

Nouveau dans la version 4.2.0.

Obsolète depuis la version 4.3.2: Use get_members() instead.

Gets all members of a guild.

Avertissement

Calling this method can lead to rate-limits in larger guilds.

Renvoie:

Returns a list of all members of the guild

Type renvoyé:

List[Member]

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

Nouveau dans la version 4.3.2.

Paramètres:
  • start_at (Optional[Union[int, str, Snowflake, Member]]) – The member to begin getting the members from

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

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

Renvoie:

An asynchronous iterator over the members of the guild

Type renvoyé:

AsyncMembersIterator

async get_webhooks()[source]#

Nouveau dans la version 4.3.0.

Get all webhooks of a guild.

Type renvoyé:

List[Webhook]

async list_auto_moderation_rules()[source]#

Nouveau dans la version 4.3.0.

Lists all AutoMod rules.

Type renvoyé:

List[AutoModerationRule]

async get_auto_moderation_rule(rule_id)[source]#

Nouveau dans la version 4.3.0.

Gets a AutoMod rule from its ID

Paramètres:

rule_id (Union[int, Snowflake]) – The ID of the rule to get

Renvoie:

A AutoMod rule

Type renvoyé:

AutoModerationRule

async create_auto_moderation_rule(name, trigger_type, actions, trigger_metadata=<interactions.MISSING>, enabled=False, exempt_roles=<interactions.MISSING>, exempt_channels=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.3.0.

Creates an AutoMod rule

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

  • trigger_type (AutoModTriggerType) – The trigger type of the new rule.

  • trigger_metadata (Optional[AutoModTriggerMetadata]) – The trigger metadata payload representation. This can be omitted based on the trigger type.

  • actions (List[AutoModAction]) – The actions that will execute when the rule is triggered.

  • enabled (Optional[bool]) – Whether the rule will be enabled upon creation. False by default.

  • exempt_roles (Optional[List[int]]) – The role IDs that are whitelisted by the rule, if given. The maximum is 20.

  • exempt_channels (Optional[List[int]]) – The channel IDs that are whitelisted by the rule, if given. The maximum is 20

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

Renvoie:

The new AutoMod rule

Type renvoyé:

AutoModerationRule

async modify_auto_moderation_rule(rule, name=<interactions.MISSING>, trigger_type=<interactions.MISSING>, actions=<interactions.MISSING>, trigger_metadata=<interactions.MISSING>, enabled=<interactions.MISSING>, exempt_roles=<interactions.MISSING>, exempt_channels=<interactions.MISSING>, reason=None)[source]#

Nouveau dans la version 4.3.0.

Edits an AutoMod rule

Paramètres:
  • rule (Union[int, Snowflake, AutoModerationRule]) – The rule to modify

  • name (str) – The name of the new rule.

  • trigger_type (AutoModTriggerType) – The trigger type of the new rule.

  • trigger_metadata (Optional[AutoModTriggerMetadata]) – The trigger metadata payload representation. This can be omitted based on the trigger type.

  • actions (List[AutoModAction]) – The actions that will execute when the rule is triggered.

  • enabled (Optional[bool]) – Whether the rule will be enabled upon creation. False by default.

  • exempt_roles (Optional[List[int]]) – The role IDs that are whitelisted by the rule, if given. The maximum is 20.

  • exempt_channels (Optional[List[int]]) – The channel IDs that are whitelisted by the rule, if given. The maximum is 20

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

Renvoie:

The new AutoMod rule

Type renvoyé:

AutoModerationRule

async get_audit_logs(limit=100, user_id=<interactions.MISSING>, action_type=<interactions.MISSING>, before=<interactions.MISSING>)[source]#

Nouveau dans la version 4.3.0.

Gets the audit logs of the guild.

Paramètres:
  • limit (Optional[int]) – How many entries to get, default 100

  • user_id (Optional[Union[User, int, Snowflake]]) – User ID snowflake. filter the log for actions made by a user.

  • action_type (Optional[Union[int, AuditLogEvents]]) – The Type of the audit log action.

  • before (Union[int, Snowflake]) – filter the log before a certain entry id.

Renvoie:

The guild audit logs

Type renvoyé:

AuditLogs

async get_latest_audit_log_action(of)[source]#

Nouveau dans la version 4.3.0.

Gets the latest audit log action of either a user or an action type

Paramètres:

of (Union[User, Snowflake, AuditLogEvents, int, Tuple[Union[User, Snowflake, int], Union[AuditLogEvents, int]]]) –

The user/user ID or action type to look for.

Detailed description:
  1. User or Member, Snowflake or member or user ID as int/str:
    return:

    The latest audit log entry of this user.

  2. AuditLogEvents or and AuditLogEvent as int representation:
    return:

    The latest audit log entry of this type.

  3. tuple object:
    return:

    The latest audit log entry of this user AND this type combined

Renvoie:

The latest AuditLog action that applies to the of parameter

Type renvoyé:

AuditLogs

async get_full_audit_logs(user_id=<interactions.MISSING>, action_type=<interactions.MISSING>)[source]#

Nouveau dans la version 4.3.0.

Gets the full audit log of the guild.

Paramètres:
  • user_id (Optional[Union[User, int, Snowflake]]) – User ID snowflake. filter the log for actions made by a user.

  • action_type (Optional[Union[int, AuditLogEvents]]) – The type of the audit log action.

Renvoie:

The full AuditLog of the guild

Type renvoyé:

AuditLogs

async get_invite(invite_code, with_counts=<interactions.MISSING>, with_expiration=<interactions.MISSING>, guild_scheduled_event_id=<interactions.MISSING>)[source]#

Nouveau dans la version 4.3.4.

Gets the invite using its code.

Paramètres:
  • invite_code (str) – A string representing the invite code.

  • with_counts (Optional[bool]) – Whether approximate_member_count and approximate_presence_count are returned.

  • with_expiration (Optional[bool]) – Whether the invite’s expiration date is returned.

  • guild_scheduled_event_id (Optional[int]) – A guild scheduled event’s ID.

Renvoie:

An invite

Type renvoyé:

Invite

async delete_invite(invite_code, reason=None)[source]#

Nouveau dans la version 4.3.4.

Deletes the invite using its code.

Paramètres:
  • invite_code (str) – A string representing the invite code.

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

async get_invites()[source]#

Nouveau dans la version 4.3.4.

Gets invites of the guild.

Renvoie:

A list of guild invites

Type renvoyé:

List[Invite]

async modify_bot_nick(new_nick=<interactions.MISSING>)[source]#

Nouveau dans la version 4.4.0.

Changes a nickname of the current bot user in a guild.

Paramètres:

new_nick (Optional[str]) – The new nickname, if any.

Renvoie:

The modified bot member object

Type renvoyé:

Member

property icon_url: str | None#

Nouveau dans la version 4.2.0.

Returns the URL of the guild’s icon.

Renvoie:

URL of the guild’s icon (None will be returned if no icon is set)

Type renvoyé:

str

property banner_url: str | None#

Nouveau dans la version 4.2.0.

Returns the URL of the guild’s banner.

Renvoie:

URL of the guild’s banner (None will be returned if no banner is set)

Type renvoyé:

str

property splash_url: str | None#

Nouveau dans la version 4.2.0.

Returns the URL of the guild’s invite splash banner.

Renvoie:

URL of the guild’s invite splash banner (None will be returned if no banner is set)

Type renvoyé:

str

property discovery_splash_url: str | None#

Nouveau dans la version 4.2.0.

Returns the URL of the guild’s discovery splash banner.

Renvoie:

URL of the guild’s discovery splash banner (None will be returned if no banner is set)

Type renvoyé:

str

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

A class object representing the preview of a guild.

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

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

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

  • splash (Optional[str]) – The invite splash banner of the guild.

  • discovery_splash (Optional[str]) – The discovery splash banner of the guild.

  • emojis (List[Emoji]) – The list of emojis from the guild.

  • features (List[GuildFeatures]) – The list of features of the guild.

  • approximate_member_count (int) – The approximate amount of members in the guild.

  • approximate_presence_count (int) – The approximate amount of presences in the guild.

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

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

The invite object.

Variables:
  • uses (int) – The amount of uses on this invite.

  • max_uses (int) – The amount of maximum uses on this invite.

  • max_age (int) – The maximum age of this invite, in seconds.

  • temporary (bool) – A detection of whether this invite only grants temporary membership.

  • created_at (datetime) – The time when this invite was created.

  • expires_at (datetime) – The time when this invite will expire.

  • type (int) – The type of this invite.

  • inviter (User) – The user who created this invite.

  • code (str) – The code of this invite.

  • guild_id (Optional[int]) – The guild ID of this invite.

  • channel_id (Optional[int]) – The channel ID of this invite.

  • target_user_type (Optional[int]) – The type of the target user of this invite.

  • target_user (Optional[User]) – The target user of this invite.

  • target_type (Optional[int]) – The target type of this invite.

  • guild (Optional[Guild]) – The guild of this invite.

  • channel (Optional[Channel]) – The channel of this invite.

  • approximate_member_count (Optional[int]) – The approximate amount of total members in a guild.

  • approximate_presence_count (Optional[int]) – The aprpoximate amount of online members in a guild.

  • guild_scheduled_event (Optional[ScheduledEvents]) – A scheduled guild event object included in the invite.

async delete()[source]#

Deletes the invite

property url: str#

Nouveau dans la version 4.3.0.

Returns the URL of the invite.

class interactions.api.models.guild.AsyncMembersIterator(_client, obj, maximum=inf, start_at=<interactions.MISSING>, check=None)[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, Guild]) – The guild to get the members from

  • start_at (Optional[Union[int, str, Snowflake, Member]]) – The member ID to start getting members from (gets all members after that member)

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

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

async flatten()[source]#

Returns all remaining items of the iterator as list.

Type renvoyé:

List[Member]