Guild Models#

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

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)[sorgente]#

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)[sorgente]#

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)[sorgente]#

A class object representing the metadata of an event entity.

Variabili:

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

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

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)[sorgente]#

An object representing the snapshot of an existing guild.

Variabili:
  • 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)[sorgente]#

A class object representing an integration in a guild.

Variabili:
  • 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)[sorgente]#

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)[sorgente]#

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

Variabili:
  • 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)[sorgente]#

A class object representing how a guild that is unavailable.

Nota

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.

Variabili:
  • 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)[sorgente]#

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

Nota

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

Variabili:
  • 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)[sorgente]#

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)[sorgente]#

A class object representing the scheduled events of a guild.

Variabili:
  • 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)[sorgente]#

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

Variabili:
  • 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)[sorgente]#

A class object representing how a guild is registered.

Nota

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.

Variabili:
  • 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]#

Nuovo nella versione 4.4.0.

Gets all voice states of the guild.

Tipo di ritorno:

List[VoiceState]

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

Nuovo nella versione 4.4.0.

Returns all the voice states mapped after their channel id.

Tipo di ritorno:

Dict[int, List[VoiceState]]

property created_at: datetime#

Nuovo nella versione 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)[sorgente]#

Nuovo nella versione 4.0.2.

Cambiato nella versione 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.

Parametri:
  • 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)[sorgente]#

Nuovo nella versione 4.0.2.

Removes the ban of a user.

Parametri:
  • 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)[sorgente]#

Nuovo nella versione 4.0.2.

Kicks a member from the guild.

Parametri:
  • 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)[sorgente]#

Nuovo nella versione 4.0.2.

This method adds a role to a member.

Parametri:
  • 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)[sorgente]#

Nuovo nella versione 4.0.2.

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

Parametri:
  • 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)[sorgente]#

Nuovo nella versione 4.0.2.

Creates a new role in the guild.

Parametri:
  • 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

Ritorna:

The created Role

Tipo di ritorno:

Role

async get_member(member_id)[sorgente]#

Nuovo nella versione 4.0.2.

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

Parametri:

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

Ritorna:

The member searched for

Tipo di ritorno:

Member

async delete_channel(channel_id)[sorgente]#

Nuovo nella versione 4.0.2.

Deletes a channel from the guild.

Parametri:

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

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

Nuovo nella versione 4.0.2.

Deletes a role from the guild.

Parametri:
  • 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)[sorgente]#

Nuovo nella versione 4.0.2.

Edits a role in the guild.

Parametri:
  • 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

Ritorna:

The modified role object

Tipo di ritorno:

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)[sorgente]#

Nuovo nella versione 4.1.0.

Creates a thread in the specified channel.

Parametri:
  • 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

Ritorna:

The created thread

Tipo di ritorno:

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)[sorgente]#

Nuovo nella versione 4.0.2.

Creates a channel in the guild.

Parametri:
  • 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

Ritorna:

The created channel

Tipo di ritorno:

Channel

async clone_channel(channel_id)[sorgente]#

Nuovo nella versione 4.3.0.

Clones a channel of the guild.

Parametri:

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

Ritorna:

The cloned channel

Tipo di ritorno:

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)[sorgente]#

Nuovo nella versione 4.0.2.

Edits a channel of the guild.

Nuovo nella versione 4.2.0::: The fields archived, auto_archive_duration and locked require the provided channel to be a thread.

Parametri:
  • 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]) –

    Nuovo nella versione 4.2.0.

    Whether the thread is archived

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

    Nuovo nella versione 4.2.0.

    The time after the thread is automatically archived. One of 60, 1440, 4320, 10080

  • locked (Optional[bool]) –

    Nuovo nella versione 4.2.0.

    Whether the thread is locked

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

Ritorna:

The modified channel

Tipo di ritorno:

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)[sorgente]#

Nuovo nella versione 4.0.2.

Modifies a member of the guild.

Parametri:
  • 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

Ritorna:

The modified member

Tipo di ritorno:

Member

async get_preview()[sorgente]#

Nuovo nella versione 4.0.2.

Get the guild’s preview.

Ritorna:

the guild preview as object

Tipo di ritorno:

GuildPreview

async leave()[sorgente]#

Nuovo nella versione 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)[sorgente]#

Nuovo nella versione 4.0.2.

Modifies the current guild.

Parametri:
  • 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]) –

    Nuovo nella versione 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]) –

    Nuovo nella versione 4.2.0.

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

  • discovery_splash (Optional[Image]) –

    Nuovo nella versione 4.2.0.

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

  • banner (Optional[Image]) –

    Nuovo nella versione 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

Ritorna:

The modified guild

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the name of the guild.

Parametri:
  • name (str) – The new name of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the verification level of the guild.

Parametri:
  • verification_level (VerificationLevel) – The new verification level of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the default message notifications level of the guild.

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

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the explicit content filter level of the guild.

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

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the afk channel of the guild.

Parametri:
  • afk_channel_id (int) – The new name of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the afk timeout of the guild.

Parametri:
  • afk_timeout (int) – The new afk timeout of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the system channel of the guild.

Parametri:
  • system_channel_id (int) – The new system channel id of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the rules channel of the guild.

Parametri:
  • rules_channel_id (int) – The new rules channel id of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the public updates channel of the guild.

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

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the preferred locale of the guild.

Parametri:
  • preferred_locale (str) – The new preferredlocale of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the description of the guild.

Parametri:
  • description (str) – The new description of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

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

Parametri:
  • premium_progress_bar_enabled (bool) – Whether the bar is enabled or not

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the icon of the guild.

Parametri:
  • icon (Image) – The new icon of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the splash of the guild.

Parametri:
  • splash (Image) – The new splash of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the discovery_splash of the guild.

Parametri:
  • discovery_splash (Image) – The new discovery_splash of the guild

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

Tipo di ritorno:

Guild

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

Nuovo nella versione 4.2.0.

Sets the banner of the guild.

Parametri:
  • banner (Image) – The new banner of the guild

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

Tipo di ritorno:

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>)[sorgente]#

Nuovo nella versione 4.0.2.

Creates a scheduled event for the guild.

Parametri:
  • 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

Ritorna:

The created event

Tipo di ritorno:

ScheduledEvents

async get_scheduled_events(with_user_count)[sorgente]#

Nuovo nella versione 4.3.2.

Gets all scheduled events of the guild.

Parametri:

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

Ritorna:

The sheduled events of the guild.

Tipo di ritorno:

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>)[sorgente]#

Nuovo nella versione 4.0.2.

Edits a scheduled event of the guild.

Parametri:
  • 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

Ritorna:

The modified event

Tipo di ritorno:

ScheduledEvents

async delete_scheduled_event(event_id)[sorgente]#

Nuovo nella versione 4.0.2.

Deletes a scheduled event of the guild.

Parametri:

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

async get_all_channels()[sorgente]#

Nuovo nella versione 4.0.2.

Gets all channels of the guild as list.

Ritorna:

The channels of the guild.

Tipo di ritorno:

List[Channel]

async get_all_active_threads()[sorgente]#

Nuovo nella versione 4.3.0.

Gets all active threads of the guild.

Ritorna:

The threads of the guild.

Tipo di ritorno:

List[Thread]

async get_all_roles()[sorgente]#

Nuovo nella versione 4.0.2.

Gets all roles of the guild as list.

Ritorna:

The roles of the guild.

Tipo di ritorno:

List[Role]

async get_role(role_id)[sorgente]#

Nuovo nella versione 4.2.0.

Gets a role of the guild.

Parametri:

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

Ritorna:

The role as object

Tipo di ritorno:

Role

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

Nuovo nella versione 4.0.2.

Modifies the position of a role in the guild.

Parametri:
  • 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

Ritorna:

List of guild roles with updated hierarchy

Tipo di ritorno:

List[Role]

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

Nuovo nella versione 4.2.0.

Modifies the positions of multiple roles in the guild.

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

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

Ritorna:

List of guild roles with updated hierarchy

Tipo di ritorno:

List[Role]

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

Nuovo nella versione 4.0.2.

Cambiato nella versione 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.

Parametri:
  • 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.

Ritorna:

List of banned users with reasons

Tipo di ritorno:

List[Dict[str, User]]

async get_all_bans()[sorgente]#

Nuovo nella versione 4.2.0.

Gets all bans of the guild.

Ritorna:

List of banned users with reasons

Tipo di ritorno:

List[Dict[str, User]]

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

Nuovo nella versione 4.3.2.

Begins a prune operation.

Parametri:
  • 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.

Ritorna:

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

Tipo di ritorno:

Optional[int]

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

Nuovo nella versione 4.3.2.

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

Parametri:
  • 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.

Ritorna:

The number of members that would be pruned.

Tipo di ritorno:

int

async get_emoji(emoji_id)[sorgente]#

Nuovo nella versione 4.2.0.

Gets an emoji of the guild and returns it.

Parametri:

emoji_id (int) – The id of the emoji

Ritorna:

The specified Emoji, if found

Tipo di ritorno:

Emoji

async get_all_emoji()[sorgente]#

Nuovo nella versione 4.2.0.

Gets all emojis of a guild.

Ritorna:

All emojis of the guild

Tipo di ritorno:

List[Emoji]

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

Nuovo nella versione 4.2.0.

Creates an Emoji in the guild.

Parametri:
  • 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

Tipo di ritorno:

Emoji

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

Nuovo nella versione 4.4.0.

Edits an Emoji in the guild.

Parametri:
  • 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

Ritorna:

The modified emoji object

Tipo di ritorno:

Emoji

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

Nuovo nella versione 4.2.0.

Deletes an emoji of the guild.

Parametri:
  • 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()[sorgente]#

Nuovo nella versione 4.3.2.

Get the stickers for a guild.

Ritorna:

List of stickers of the guild.

Tipo di ritorno:

Optional[List[Sticker]]

async get_nitro_sticker_packs()[sorgente]#

Nuovo nella versione 4.3.2.

Gets the list of sticker packs available to Nitro subscribers.

Ritorna:

List of sticker packs.

Tipo di ritorno:

List[StickerPack]

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

Nuovo nella versione 4.3.2.

Creates a new sticker for the guild.

Parametri:
  • 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.

Ritorna:

Created sticker for the guild.

Tipo di ritorno:

Sticker

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

Nuovo nella versione 4.3.2.

Modifies the sticker of the guild.

Parametri:
  • 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.

Ritorna:

Modified sticker.

Tipo di ritorno:

Sticker

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

Nuovo nella versione 4.3.2.

Deletes the sticker of the guild.

Parametri:
  • 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>)[sorgente]#

Nuovo nella versione 4.2.0.

Lists the members of a guild.

Parametri:
  • 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.

Ritorna:

A list of members

Tipo di ritorno:

List[Member]

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

Nuovo nella versione 4.2.0.

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

Parametri:
  • query (str) – The string to search for

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

Ritorna:

A list of matching members

Tipo di ritorno:

List[Member]

async get_all_members()[sorgente]#

Nuovo nella versione 4.2.0.

Deprecato dalla versione 4.3.2: Use get_members() instead.

Gets all members of a guild.

Avvertimento

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

Ritorna:

Returns a list of all members of the guild

Tipo di ritorno:

List[Member]

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

Nuovo nella versione 4.3.2.

Parametri:
  • 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

Ritorna:

An asynchronous iterator over the members of the guild

Tipo di ritorno:

AsyncMembersIterator

async get_webhooks()[sorgente]#

Nuovo nella versione 4.3.0.

Get all webhooks of a guild.

Tipo di ritorno:

List[Webhook]

async list_auto_moderation_rules()[sorgente]#

Nuovo nella versione 4.3.0.

Lists all AutoMod rules.

Tipo di ritorno:

List[AutoModerationRule]

async get_auto_moderation_rule(rule_id)[sorgente]#

Nuovo nella versione 4.3.0.

Gets a AutoMod rule from its ID

Parametri:

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

Ritorna:

A AutoMod rule

Tipo di ritorno:

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)[sorgente]#

Nuovo nella versione 4.3.0.

Creates an AutoMod rule

Parametri:
  • 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

Ritorna:

The new AutoMod rule

Tipo di ritorno:

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)[sorgente]#

Nuovo nella versione 4.3.0.

Edits an AutoMod rule

Parametri:
  • 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

Ritorna:

The new AutoMod rule

Tipo di ritorno:

AutoModerationRule

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

Nuovo nella versione 4.3.0.

Gets the audit logs of the guild.

Parametri:
  • 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.

Ritorna:

The guild audit logs

Tipo di ritorno:

AuditLogs

async get_latest_audit_log_action(of)[sorgente]#

Nuovo nella versione 4.3.0.

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

Parametri:

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

Ritorna:

The latest AuditLog action that applies to the of parameter

Tipo di ritorno:

AuditLogs

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

Nuovo nella versione 4.3.0.

Gets the full audit log of the guild.

Parametri:
  • 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.

Ritorna:

The full AuditLog of the guild

Tipo di ritorno:

AuditLogs

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

Nuovo nella versione 4.3.4.

Gets the invite using its code.

Parametri:
  • 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.

Ritorna:

An invite

Tipo di ritorno:

Invite

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

Nuovo nella versione 4.3.4.

Deletes the invite using its code.

Parametri:
  • invite_code (str) – A string representing the invite code.

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

async get_invites()[sorgente]#

Nuovo nella versione 4.3.4.

Gets invites of the guild.

Ritorna:

A list of guild invites

Tipo di ritorno:

List[Invite]

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

Nuovo nella versione 4.4.0.

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

Parametri:

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

Ritorna:

The modified bot member object

Tipo di ritorno:

Member

property icon_url: str | None#

Nuovo nella versione 4.2.0.

Returns the URL of the guild’s icon.

Ritorna:

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

Tipo di ritorno:

str

property banner_url: str | None#

Nuovo nella versione 4.2.0.

Returns the URL of the guild’s banner.

Ritorna:

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

Tipo di ritorno:

str

property splash_url: str | None#

Nuovo nella versione 4.2.0.

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

Ritorna:

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

Tipo di ritorno:

str

property discovery_splash_url: str | None#

Nuovo nella versione 4.2.0.

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

Ritorna:

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

Tipo di ritorno:

str

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

A class object representing the preview of a guild.

Variabili:
  • 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)[sorgente]#

The invite object.

Variabili:
  • 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()[sorgente]#

Deletes the invite

property url: str#

Nuovo nella versione 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)[sorgente]#

Nuovo nella versione 4.3.2.

A class object that allows iterating through a channel’s history.

Parametri:
  • _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()[sorgente]#

Returns all remaining items of the iterator as list.

Tipo di ritorno:

List[Member]