Skip to content

hikari.guilds#

Application and entities that are used to describe guilds on Discord.

GatewayGuild #

Bases: Guild

Guild specialization that is sent via the gateway only.

afk_channel_id class-attribute instance-attribute #

afk_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID for the channel that AFK voice users get sent to.

If None, then no AFK channel is set up for this guild.

afk_timeout class-attribute instance-attribute #

afk_timeout: timedelta = field(eq=False, hash=False, repr=False)

Timeout for activity before a member is classed as AFK.

How long a voice user has to be AFK for before they are classed as being AFK and are moved to the AFK channel (hikari.guilds.Guild.afk_channel_id).

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False, eq=False, hash=False, metadata={SKIP_DEEP_COPY: True}
)

Client application that models may use for procedures.

application_id class-attribute instance-attribute #

application_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the application that created this guild.

This will always be None for guilds that weren't created by a bot.

banner_hash class-attribute instance-attribute #

banner_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash for the guild's banner.

This is only present if the guild has hikari.guilds.GuildFeature.BANNER in hikari.guilds.Guild.features for this guild. For all other purposes, it is None.

banner_url property #

banner_url: Optional[URL]

Banner URL for the guild, if set.

created_at property #

created_at: datetime

When the object was created.

default_message_notifications class-attribute instance-attribute #

default_message_notifications: Union[GuildMessageNotificationsLevel, int] = (
    field(eq=False, hash=False, repr=False)
)

The default setting for message notifications in this guild.

description class-attribute instance-attribute #

description: Optional[str] = field(eq=False, hash=False, repr=False)

The guild's description.

This is only present if certain hikari.guilds.GuildFeature's are set in hikari.guilds.Guild.features for this guild. Otherwise, this will always be None.

discovery_splash_hash class-attribute instance-attribute #

discovery_splash_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash of the discovery splash for the guild, if there is one.

discovery_splash_url property #

discovery_splash_url: Optional[URL]

Discovery splash URL for the guild, if set.

explicit_content_filter class-attribute instance-attribute #

explicit_content_filter: Union[GuildExplicitContentFilterLevel, int] = field(
    eq=False, hash=False, repr=False
)

The setting for the explicit content filter in this guild.

features class-attribute instance-attribute #

features: Sequence[Union[str, GuildFeature]] = field(
    eq=False, hash=False, repr=False
)

A list of the features in this guild.

icon_hash class-attribute instance-attribute #

icon_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash for the guild icon, if there is one.

icon_url property #

icon_url: Optional[URL]

Icon URL for the guild, if set; otherwise None.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

is_large class-attribute instance-attribute #

is_large: Optional[bool] = field(eq=False, hash=False, repr=False)

Whether the guild is considered to be large or not.

This information is only available if the guild was sent via a GUILD_CREATE event. If the guild is received from any other place, this will always be None.

The implications of a large guild are that presence information will not be sent about members who are offline or invisible.

is_widget_enabled class-attribute instance-attribute #

is_widget_enabled: Optional[bool] = field(eq=False, hash=False, repr=False)

Describes whether the guild widget is enabled or not.

If this information is not present, this will be None.

joined_at class-attribute instance-attribute #

joined_at: Optional[datetime] = field(eq=False, hash=False, repr=False)

The date and time that the bot user joined this guild.

This information is only available if the guild was sent via a GUILD_CREATE event. If the guild is received from any other place, this will always be None.

max_video_channel_users class-attribute instance-attribute #

max_video_channel_users: Optional[int] = field(eq=False, hash=False, repr=False)

The maximum number of users allowed in a video channel together.

This information may not be present, in which case, it will be None.

member_count class-attribute instance-attribute #

member_count: Optional[int] = field(eq=False, hash=False, repr=False)

The number of members in this guild.

This information is only available if the guild was sent via a GUILD_CREATE event. If the guild is received from any other place, this will always be None.

mfa_level class-attribute instance-attribute #

mfa_level: Union[GuildMFALevel, int] = field(eq=False, hash=False, repr=False)

The required MFA level for users wishing to participate in this guild.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of the guild.

nsfw_level class-attribute instance-attribute #

nsfw_level: GuildNSFWLevel = field(eq=False, hash=False, repr=False)

The NSFW level of the guild.

owner_id class-attribute instance-attribute #

owner_id: Snowflake = field(eq=False, hash=False, repr=True)

The ID of the owner of this guild.

preferred_locale class-attribute instance-attribute #

preferred_locale: Union[str, Locale] = field(eq=False, hash=False, repr=False)

The preferred locale to use for this guild.

This can only be change if hikari.guilds.GuildFeature.COMMUNITY is in hikari.guilds.Guild.features for this guild and will otherwise default to en-US.

premium_subscription_count class-attribute instance-attribute #

premium_subscription_count: Optional[int] = field(
    eq=False, hash=False, repr=False
)

The number of nitro boosts that the server currently has.

This information may not be present, in which case, it will be None.

premium_tier class-attribute instance-attribute #

premium_tier: Union[GuildPremiumTier, int] = field(
    eq=False, hash=False, repr=False
)

The premium tier for this guild.

public_updates_channel_id class-attribute instance-attribute #

public_updates_channel_id: Optional[Snowflake] = field(
    eq=False, hash=False, repr=False
)

The channel ID of the channel where admins and moderators receive notices from Discord.

This is only present if hikari.guilds.GuildFeature.COMMUNITY is in hikari.guilds.Guild.features for this guild. For all other purposes, it should be considered to be None.

rules_channel_id class-attribute instance-attribute #

rules_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the channel where rules and guidelines will be displayed.

If the hikari.guilds.GuildFeature.COMMUNITY feature is not defined, then this is None.

shard_id property #

shard_id: Optional[int]

Return the ID of the shard this guild is served by.

This may return None if the application does not have a gateway connection.

splash_hash class-attribute instance-attribute #

splash_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash of the splash for the guild, if there is one.

splash_url property #

splash_url: Optional[URL]

Splash URL for the guild, if set.

system_channel_flags class-attribute instance-attribute #

system_channel_flags: GuildSystemChannelFlag = field(
    eq=False, hash=False, repr=False
)

Return flags for the guild system channel.

These are used to describe which notifications are suppressed.

system_channel_id class-attribute instance-attribute #

system_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the system channel or None if it is not enabled.

Welcome messages and Nitro boost messages may be sent to this channel.

vanity_url_code class-attribute instance-attribute #

vanity_url_code: Optional[str] = field(eq=False, hash=False, repr=False)

The vanity URL code for the guild's vanity URL.

This is only present if hikari.guilds.GuildFeature.VANITY_URL is in hikari.guilds.Guild.features for this guild. If not, this will always be None.

verification_level class-attribute instance-attribute #

verification_level: Union[GuildVerificationLevel, int] = field(
    eq=False, hash=False, repr=False
)

The verification level needed for a user to participate in this guild.

widget_channel_id class-attribute instance-attribute #

widget_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The channel ID that the widget's generated invite will send the user to.

If this information is unavailable or this is not enabled for the guild then this will be None.

ban async #

ban(
    user: SnowflakeishOr[PartialUser],
    *,
    delete_message_seconds: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Ban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to ban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
delete_message_seconds

If provided, the number of seconds to delete messages for. This can be represented as either an int/float between 0 and 604800 (7 days), or a datetime.timedelta object.

TYPE: UndefinedNoneOr[Intervalish]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_category async #

create_category(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildCategory

Create a category in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildCategory

The created category.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_forum_channel async #

create_forum_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    default_auto_archive_duration: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_thread_rate_limit_per_user: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_forum_layout: UndefinedOr[
        Union[ForumLayoutType, int]
    ] = undefined.UNDEFINED,
    default_sort_order: UndefinedOr[
        Union[ForumSortOrderType, int]
    ] = undefined.UNDEFINED,
    available_tags: UndefinedOr[Sequence[ForumTag]] = undefined.UNDEFINED,
    default_reaction_emoji: Union[
        str, Emoji, UndefinedType, Snowflake
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildForumChannel

Create a forum channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

default_auto_archive_duration

If provided, the auto archive duration Discord's end user client should default to when creating threads in this channel.

This should be either 60, 1440, 4320 or 10080 minutes and, as of writing, ignores the parent channel's set default_auto_archive_duration when passed as hikari.undefined.UNDEFINED.

TYPE: UndefinedOr[Intervalish]

default_thread_rate_limit_per_user

If provided, the ratelimit that should be set in threads created from the forum.

TYPE: UndefinedOr[Intervalish]

default_forum_layout

If provided, the default forum layout to show in the client.

TYPE: UndefinedOr[Union[ForumLayoutType, int]]

default_sort_order

If provided, the default sort order to show in the client.

TYPE: UndefinedOr[Union[ForumSortOrderType, int]]

available_tags

If provided, the available tags to select from when creating a thread.

TYPE: UndefinedOr[Sequence[ForumTag]]

default_reaction_emoji

If provided, the new default reaction emoji for threads created in a forum channel.

TYPE: Union[str, Emoji, UndefinedType, Snowflake]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildForumChannel

The created forum channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_news_channel async #

create_news_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildNewsChannel

Create a news channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildNewsChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_stage_channel async #

create_stage_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildStageChannel

Create a stage channel in the guild.

PARAMETER DESCRIPTION
name

The channel's name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildStageChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_sticker async #

create_sticker(
    name: str,
    tag: str,
    image: Resourceish,
    *,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Create a sticker in a guild.

Note

Lottie support is only available for verified and partnered servers.

PARAMETER DESCRIPTION
name

The name for the sticker.

TYPE: str

tag

The tag for the sticker.

TYPE: str

image

The 320x320 image for the sticker. Maximum upload size is 500kb. This can be a still PNG, an animated PNG, a Lottie, or a GIF.

TYPE: Resourceish

PARAMETER DESCRIPTION
description

If provided, the description of the sticker.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The created sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value or if there are no more spaces for the sticker in the guild.

ForbiddenError
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_text_channel async #

create_text_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildTextChannel

Create a text channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildTextChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_voice_channel async #

create_voice_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    video_quality_mode: UndefinedOr[
        Union[VideoQualityMode, int]
    ] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildVoiceChannel

Create a voice channel in a guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

video_quality_mode

If provided, the new video quality mode for the channel.

TYPE: UndefinedOr[Union[VideoQualityMode, int]]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildVoiceChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the gui ld is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_channel async #

delete_channel(channel: SnowflakeishOr[GuildChannel]) -> GuildChannel

Delete a channel in the guild.

Note

This method can also be used for deleting guild categories as well.

Note

For Public servers, the set 'Rules' or 'Guidelines' channels and the 'Public Server Updates' channel cannot be deleted.

PARAMETER DESCRIPTION
channel

The channel or category to delete. This may be the object or the ID of an existing channel.

TYPE: SnowflakeishOr[GuildChannel]

RETURNS DESCRIPTION
GuildChannel

Object of the channel or category that was deleted.

RAISES DESCRIPTION
hikari.errors.UnauthorizedError, or close a DM.

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_sticker async #

delete_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Delete a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to delete. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit async #

edit(
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    verification_level: UndefinedOr[
        GuildVerificationLevel
    ] = undefined.UNDEFINED,
    default_message_notifications: UndefinedOr[
        GuildMessageNotificationsLevel
    ] = undefined.UNDEFINED,
    explicit_content_filter_level: UndefinedOr[
        GuildExplicitContentFilterLevel
    ] = undefined.UNDEFINED,
    afk_channel: UndefinedOr[
        SnowflakeishOr[GuildVoiceChannel]
    ] = undefined.UNDEFINED,
    afk_timeout: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    icon: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    owner: UndefinedOr[SnowflakeishOr[PartialUser]] = undefined.UNDEFINED,
    splash: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    banner: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    system_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    rules_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    public_updates_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    preferred_locale: UndefinedOr[Union[str, Locale]] = undefined.UNDEFINED,
    features: UndefinedOr[Sequence[GuildFeature]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> RESTGuild

Edit the guild.

PARAMETER DESCRIPTION
name

If provided, the new name for the guild.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

verification_level

If provided, the new verification level.

TYPE: UndefinedOr[GuildVerificationLevel] DEFAULT: UNDEFINED

default_message_notifications

If provided, the new default message notifications level.

TYPE: UndefinedOr[GuildMessageNotificationsLevel] DEFAULT: UNDEFINED

explicit_content_filter_level

If provided, the new explicit content filter level.

TYPE: UndefinedOr[GuildExplicitContentFilterLevel] DEFAULT: UNDEFINED

afk_channel

If provided, the new afk channel. Requires afk_timeout to be set to work.

TYPE: UndefinedOr[SnowflakeishOr[GuildVoiceChannel]] DEFAULT: UNDEFINED

afk_timeout

If provided, the new afk timeout.

TYPE: UndefinedOr[Intervalish] DEFAULT: UNDEFINED

icon

If provided, the new guild icon. Must be a 1024x1024 image or can be an animated gif when the guild has the hikari.guilds.GuildFeature.ANIMATED_ICON feature.

TYPE: UndefinedOr[Resourceish] DEFAULT: UNDEFINED

owner

If provided, the new guild owner.

Warning

You need to be the owner of the server to use this.

TYPE: hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishOr[hikari.users.PartialUser]]] DEFAULT: UNDEFINED

splash

If provided, the new guild splash. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.INVITE_SPLASH feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

banner

If provided, the new guild banner. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.BANNER feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

system_channel

If provided, the new system channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

rules_channel

If provided, the new rules channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

public_updates_channel

If provided, the new public updates channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

preferred_locale

If provided, the new preferred locale.

TYPE: UndefinedNoneOr[str] DEFAULT: UNDEFINED

features

If provided, the guild features to be enabled. Features not provided will be disabled.

TYPE: UndefinedOr[Sequence[GuildFeatures]] DEFAULT: UNDEFINED

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
RESTGuild

The edited guild.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value. Or you are missing the

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_GUILD permission or if you tried to pass ownership without being the server owner.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit_sticker async #

edit_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    tag: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Edit a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to edit. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
name

If provided, the new name for the sticker.

TYPE: UndefinedOr[str]

description

If provided, the new description for the sticker.

TYPE: UndefinedOr[str]

tag

If provided, the new sticker tag.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The edited sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_afk_channel async #

fetch_afk_channel() -> Optional[GuildVoiceChannel]

Fetch the channel that AFK voice users get sent to.

RETURNS DESCRIPTION
Optional[GuildVoiceChannel]

The AFK channel or None if not enabled.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emoji async #

Fetch an emoji from the guild.

PARAMETER DESCRIPTION
emoji

The emoji to fetch. This can be a hikari.emojis.CustomEmoji or the ID of an existing emoji.

TYPE: SnowflakeishOr[CustomEmoji]

RETURNS DESCRIPTION
KnownCustomEmoji

The requested emoji.

RAISES DESCRIPTION
NotFoundError

If the guild or the emoji are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emojis async #

fetch_emojis() -> Sequence[KnownCustomEmoji]

Fetch the emojis of the guild.

RETURNS DESCRIPTION
Sequence[KnownCustomEmoji]

The requested emojis.

RAISES DESCRIPTION
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_owner async #

fetch_owner() -> Member

Fetch the owner of the guild.

RETURNS DESCRIPTION
Member

The guild owner.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or the user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_public_updates_channel async #

fetch_public_updates_channel() -> Optional[GuildTextChannel]

Fetch channel ID of the channel where admins and moderators receive notices from Discord.

This is only present if hikari.guilds.GuildFeature.COMMUNITY is in hikari.guilds.Guild.features for this guild. For all other purposes, it should be considered to be None.

RETURNS DESCRIPTION
Optional[GuildTextChannel]

The channel where discord sends relevant updates to moderators and admins.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_roles async #

fetch_roles() -> Sequence[Role]

Fetch the roles of the guild.

RETURNS DESCRIPTION
Sequence[Role]

The requested roles.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_rules_channel async #

fetch_rules_channel() -> Optional[GuildTextChannel]

Fetch the channel where guilds display rules and guidelines.

If the hikari.guilds.GuildFeature.COMMUNITY feature is not defined, then this is None.

RETURNS DESCRIPTION
Optional[GuildTextChannel]

The channel where the rules of the guild are specified or else None.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_self async #

fetch_self() -> RESTGuild

Fetch the guild.

RETURNS DESCRIPTION
RESTGuild

The requested guild.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the guild.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_sticker async #

fetch_sticker(sticker: SnowflakeishOr[PartialSticker]) -> GuildSticker

Fetch a sticker from the guild.

PARAMETER DESCRIPTION
sticker

The sticker to fetch. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

RETURNS DESCRIPTION
GuildSticker

The requested sticker.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_stickers async #

fetch_stickers() -> Sequence[GuildSticker]

Fetch the stickers of the guild.

RETURNS DESCRIPTION
Sequence[GuildSticker]

The requested stickers.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_system_channel async #

fetch_system_channel() -> Optional[GuildTextChannel]

Fetch the system channel.

RETURNS DESCRIPTION
Optional[GuildTextChannel]

The system channel for this guild or None if not enabled.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_widget_channel async #

fetch_widget_channel() -> Optional[GuildChannel]

Fetch the widget channel.

This will be None if not set.

RETURNS DESCRIPTION
Optional[GuildChannel]

The channel the widget is linked to or else None.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

get_channel #

Get a cached channel that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
channel

The object or ID of the guild channel to get from the cache.

TYPE: SnowflakeishOr[PartialChannel]

RETURNS DESCRIPTION
Optional[GuildChannel]

The object of the guild channel found in cache or None.

get_channels #

Get the channels cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, GuildChannel]

A mapping of channel IDs to objects of the channels cached for the guild.

get_emoji #

Get a cached emoji that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
emoji

The object or ID of the emoji to get from the cache.

TYPE: SnowflakeishOr[CustomEmoji]

RETURNS DESCRIPTION
Optional[KnownCustomEmoji]

The object of the custom emoji if found in cache, else None.

get_emojis #

Return the emojis in this guild.

RETURNS DESCRIPTION
Mapping[Snowflake, KnownCustomEmoji]

A mapping of emoji IDs to the objects of emojis in this guild.

get_member #

get_member(user: SnowflakeishOr[PartialUser]) -> Optional[Member]

Get a cached member that belongs to the guild by it's user ID or object.

PARAMETER DESCRIPTION
user

The object or ID of the user to get the cached member for.

TYPE: SnowflakeishOr[PartialUser]

RETURNS DESCRIPTION
Optional[Member]

The cached member object if found, else None.

get_members #

get_members() -> Mapping[Snowflake, Member]

Get the members cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, Member]

A mapping of user IDs to objects of the members cached for the guild.

get_my_member #

get_my_member() -> Optional[Member]

Return the cached member for the bot user in this guild, if known.

RETURNS DESCRIPTION
Optional[Member]

The cached member for this guild, or None if not known.

get_presence #

Get a cached presence that belongs to the guild by it's user ID or object.

PARAMETER DESCRIPTION
user

The object or ID of the user to get the cached presence for.

TYPE: SnowflakeishOr[PartialUser]

RETURNS DESCRIPTION
Optional[MemberPresence]

The cached presence object if found, else None.

get_presences #

get_presences() -> Mapping[Snowflake, MemberPresence]

Get the presences cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, MemberPresence]

A mapping of user IDs to objects of the presences cached for the guild.

get_role #

get_role(role: SnowflakeishOr[PartialRole]) -> Optional[Role]

Get a cached role that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
role

The object or ID of the role to get for this guild from the cache.

TYPE: SnowflakeishOr[PartialRole]

RETURNS DESCRIPTION
Optional[Role]

The object of the role found in cache, else None.

get_roles #

get_roles() -> Mapping[Snowflake, Role]

Return the roles in this guild.

RETURNS DESCRIPTION
Mapping[Snowflake, Role]

A mapping of role IDs to the objects of roles in this guild.

get_sticker #

get_sticker(sticker: SnowflakeishOr[GuildSticker]) -> Optional[GuildSticker]

Get a cached sticker that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
sticker

The object or ID of the sticker to get from the cache.

TYPE: SnowflakeishOr[GuildSticker]

RETURNS DESCRIPTION
Optional[GuildSticker]

The object of the sticker if found in cache, else None.

get_stickers #

get_stickers() -> Mapping[Snowflake, GuildSticker]

Return the stickers in this guild.

RETURNS DESCRIPTION
Mapping[Snowflake, GuildSticker]

A mapping of sticker IDs to the objects of sticker in this guild.

get_voice_state #

get_voice_state(user: SnowflakeishOr[PartialUser]) -> Optional[VoiceState]

Get a cached voice state that belongs to the guild by it's user.

PARAMETER DESCRIPTION
user

The object or ID of the user to get the cached voice state for.

TYPE: SnowflakeishOr[PartialUser]

RETURNS DESCRIPTION
Optional[VoiceState]

The cached voice state object if found, else None.

get_voice_states #

get_voice_states() -> Mapping[Snowflake, VoiceState]

Get the voice states cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, VoiceState]

A mapping of user IDs to objects of the voice states cached for the guild.

kick async #

kick(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Kick the given user from this guild.

PARAMETER DESCRIPTION
user

The user to kick from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.KICK_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

make_banner_url #

make_banner_url(
    *, ext: Optional[str] = None, size: int = 4096
) -> Optional[URL]

Generate the guild's banner image URL, if set.

PARAMETER DESCRIPTION
ext

The ext to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the banner is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL of the banner, or None if no banner is set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_discovery_splash_url #

make_discovery_splash_url(
    *, ext: str = "png", size: int = 4096
) -> Optional[URL]

Generate the guild's discovery splash image URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL, defaults to png. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL, defaults to 4096. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The string URL.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_icon_url #

make_icon_url(*, ext: Optional[str] = None, size: int = 4096) -> Optional[URL]

Generate the guild's icon URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the icon is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the resource, or None if no icon is set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_splash_url #

make_splash_url(*, ext: str = 'png', size: int = 4096) -> Optional[URL]

Generate the guild's splash image URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL, defaults to png. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL, defaults to 4096. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the splash, or None if not set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

unban async #

unban(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Unban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to unban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

Guild #

Bases: PartialGuild

A representation of a guild on Discord.

afk_channel_id class-attribute instance-attribute #

afk_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID for the channel that AFK voice users get sent to.

If None, then no AFK channel is set up for this guild.

afk_timeout class-attribute instance-attribute #

afk_timeout: timedelta = field(eq=False, hash=False, repr=False)

Timeout for activity before a member is classed as AFK.

How long a voice user has to be AFK for before they are classed as being AFK and are moved to the AFK channel (hikari.guilds.Guild.afk_channel_id).

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False, eq=False, hash=False, metadata={SKIP_DEEP_COPY: True}
)

Client application that models may use for procedures.

application_id class-attribute instance-attribute #

application_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the application that created this guild.

This will always be None for guilds that weren't created by a bot.

banner_hash class-attribute instance-attribute #

banner_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash for the guild's banner.

This is only present if the guild has hikari.guilds.GuildFeature.BANNER in hikari.guilds.Guild.features for this guild. For all other purposes, it is None.

banner_url property #

banner_url: Optional[URL]

Banner URL for the guild, if set.

created_at property #

created_at: datetime

When the object was created.

default_message_notifications class-attribute instance-attribute #

default_message_notifications: Union[GuildMessageNotificationsLevel, int] = (
    field(eq=False, hash=False, repr=False)
)

The default setting for message notifications in this guild.

description class-attribute instance-attribute #

description: Optional[str] = field(eq=False, hash=False, repr=False)

The guild's description.

This is only present if certain hikari.guilds.GuildFeature's are set in hikari.guilds.Guild.features for this guild. Otherwise, this will always be None.

discovery_splash_hash class-attribute instance-attribute #

discovery_splash_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash of the discovery splash for the guild, if there is one.

discovery_splash_url property #

discovery_splash_url: Optional[URL]

Discovery splash URL for the guild, if set.

explicit_content_filter class-attribute instance-attribute #

explicit_content_filter: Union[GuildExplicitContentFilterLevel, int] = field(
    eq=False, hash=False, repr=False
)

The setting for the explicit content filter in this guild.

features class-attribute instance-attribute #

features: Sequence[Union[str, GuildFeature]] = field(
    eq=False, hash=False, repr=False
)

A list of the features in this guild.

icon_hash class-attribute instance-attribute #

icon_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash for the guild icon, if there is one.

icon_url property #

icon_url: Optional[URL]

Icon URL for the guild, if set; otherwise None.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

is_widget_enabled class-attribute instance-attribute #

is_widget_enabled: Optional[bool] = field(eq=False, hash=False, repr=False)

Describes whether the guild widget is enabled or not.

If this information is not present, this will be None.

max_video_channel_users class-attribute instance-attribute #

max_video_channel_users: Optional[int] = field(eq=False, hash=False, repr=False)

The maximum number of users allowed in a video channel together.

This information may not be present, in which case, it will be None.

mfa_level class-attribute instance-attribute #

mfa_level: Union[GuildMFALevel, int] = field(eq=False, hash=False, repr=False)

The required MFA level for users wishing to participate in this guild.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of the guild.

nsfw_level class-attribute instance-attribute #

nsfw_level: GuildNSFWLevel = field(eq=False, hash=False, repr=False)

The NSFW level of the guild.

owner_id class-attribute instance-attribute #

owner_id: Snowflake = field(eq=False, hash=False, repr=True)

The ID of the owner of this guild.

preferred_locale class-attribute instance-attribute #

preferred_locale: Union[str, Locale] = field(eq=False, hash=False, repr=False)

The preferred locale to use for this guild.

This can only be change if hikari.guilds.GuildFeature.COMMUNITY is in hikari.guilds.Guild.features for this guild and will otherwise default to en-US.

premium_subscription_count class-attribute instance-attribute #

premium_subscription_count: Optional[int] = field(
    eq=False, hash=False, repr=False
)

The number of nitro boosts that the server currently has.

This information may not be present, in which case, it will be None.

premium_tier class-attribute instance-attribute #

premium_tier: Union[GuildPremiumTier, int] = field(
    eq=False, hash=False, repr=False
)

The premium tier for this guild.

public_updates_channel_id class-attribute instance-attribute #

public_updates_channel_id: Optional[Snowflake] = field(
    eq=False, hash=False, repr=False
)

The channel ID of the channel where admins and moderators receive notices from Discord.

This is only present if hikari.guilds.GuildFeature.COMMUNITY is in hikari.guilds.Guild.features for this guild. For all other purposes, it should be considered to be None.

rules_channel_id class-attribute instance-attribute #

rules_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the channel where rules and guidelines will be displayed.

If the hikari.guilds.GuildFeature.COMMUNITY feature is not defined, then this is None.

shard_id property #

shard_id: Optional[int]

Return the ID of the shard this guild is served by.

This may return None if the application does not have a gateway connection.

splash_hash class-attribute instance-attribute #

splash_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash of the splash for the guild, if there is one.

splash_url property #

splash_url: Optional[URL]

Splash URL for the guild, if set.

system_channel_flags class-attribute instance-attribute #

system_channel_flags: GuildSystemChannelFlag = field(
    eq=False, hash=False, repr=False
)

Return flags for the guild system channel.

These are used to describe which notifications are suppressed.

system_channel_id class-attribute instance-attribute #

system_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the system channel or None if it is not enabled.

Welcome messages and Nitro boost messages may be sent to this channel.

vanity_url_code class-attribute instance-attribute #

vanity_url_code: Optional[str] = field(eq=False, hash=False, repr=False)

The vanity URL code for the guild's vanity URL.

This is only present if hikari.guilds.GuildFeature.VANITY_URL is in hikari.guilds.Guild.features for this guild. If not, this will always be None.

verification_level class-attribute instance-attribute #

verification_level: Union[GuildVerificationLevel, int] = field(
    eq=False, hash=False, repr=False
)

The verification level needed for a user to participate in this guild.

widget_channel_id class-attribute instance-attribute #

widget_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The channel ID that the widget's generated invite will send the user to.

If this information is unavailable or this is not enabled for the guild then this will be None.

ban async #

ban(
    user: SnowflakeishOr[PartialUser],
    *,
    delete_message_seconds: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Ban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to ban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
delete_message_seconds

If provided, the number of seconds to delete messages for. This can be represented as either an int/float between 0 and 604800 (7 days), or a datetime.timedelta object.

TYPE: UndefinedNoneOr[Intervalish]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_category async #

create_category(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildCategory

Create a category in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildCategory

The created category.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_forum_channel async #

create_forum_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    default_auto_archive_duration: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_thread_rate_limit_per_user: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_forum_layout: UndefinedOr[
        Union[ForumLayoutType, int]
    ] = undefined.UNDEFINED,
    default_sort_order: UndefinedOr[
        Union[ForumSortOrderType, int]
    ] = undefined.UNDEFINED,
    available_tags: UndefinedOr[Sequence[ForumTag]] = undefined.UNDEFINED,
    default_reaction_emoji: Union[
        str, Emoji, UndefinedType, Snowflake
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildForumChannel

Create a forum channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

default_auto_archive_duration

If provided, the auto archive duration Discord's end user client should default to when creating threads in this channel.

This should be either 60, 1440, 4320 or 10080 minutes and, as of writing, ignores the parent channel's set default_auto_archive_duration when passed as hikari.undefined.UNDEFINED.

TYPE: UndefinedOr[Intervalish]

default_thread_rate_limit_per_user

If provided, the ratelimit that should be set in threads created from the forum.

TYPE: UndefinedOr[Intervalish]

default_forum_layout

If provided, the default forum layout to show in the client.

TYPE: UndefinedOr[Union[ForumLayoutType, int]]

default_sort_order

If provided, the default sort order to show in the client.

TYPE: UndefinedOr[Union[ForumSortOrderType, int]]

available_tags

If provided, the available tags to select from when creating a thread.

TYPE: UndefinedOr[Sequence[ForumTag]]

default_reaction_emoji

If provided, the new default reaction emoji for threads created in a forum channel.

TYPE: Union[str, Emoji, UndefinedType, Snowflake]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildForumChannel

The created forum channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_news_channel async #

create_news_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildNewsChannel

Create a news channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildNewsChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_stage_channel async #

create_stage_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildStageChannel

Create a stage channel in the guild.

PARAMETER DESCRIPTION
name

The channel's name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildStageChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_sticker async #

create_sticker(
    name: str,
    tag: str,
    image: Resourceish,
    *,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Create a sticker in a guild.

Note

Lottie support is only available for verified and partnered servers.

PARAMETER DESCRIPTION
name

The name for the sticker.

TYPE: str

tag

The tag for the sticker.

TYPE: str

image

The 320x320 image for the sticker. Maximum upload size is 500kb. This can be a still PNG, an animated PNG, a Lottie, or a GIF.

TYPE: Resourceish

PARAMETER DESCRIPTION
description

If provided, the description of the sticker.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The created sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value or if there are no more spaces for the sticker in the guild.

ForbiddenError
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_text_channel async #

create_text_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildTextChannel

Create a text channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildTextChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_voice_channel async #

create_voice_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    video_quality_mode: UndefinedOr[
        Union[VideoQualityMode, int]
    ] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildVoiceChannel

Create a voice channel in a guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

video_quality_mode

If provided, the new video quality mode for the channel.

TYPE: UndefinedOr[Union[VideoQualityMode, int]]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildVoiceChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the gui ld is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_channel async #

delete_channel(channel: SnowflakeishOr[GuildChannel]) -> GuildChannel

Delete a channel in the guild.

Note

This method can also be used for deleting guild categories as well.

Note

For Public servers, the set 'Rules' or 'Guidelines' channels and the 'Public Server Updates' channel cannot be deleted.

PARAMETER DESCRIPTION
channel

The channel or category to delete. This may be the object or the ID of an existing channel.

TYPE: SnowflakeishOr[GuildChannel]

RETURNS DESCRIPTION
GuildChannel

Object of the channel or category that was deleted.

RAISES DESCRIPTION
hikari.errors.UnauthorizedError, or close a DM.

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_sticker async #

delete_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Delete a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to delete. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit async #

edit(
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    verification_level: UndefinedOr[
        GuildVerificationLevel
    ] = undefined.UNDEFINED,
    default_message_notifications: UndefinedOr[
        GuildMessageNotificationsLevel
    ] = undefined.UNDEFINED,
    explicit_content_filter_level: UndefinedOr[
        GuildExplicitContentFilterLevel
    ] = undefined.UNDEFINED,
    afk_channel: UndefinedOr[
        SnowflakeishOr[GuildVoiceChannel]
    ] = undefined.UNDEFINED,
    afk_timeout: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    icon: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    owner: UndefinedOr[SnowflakeishOr[PartialUser]] = undefined.UNDEFINED,
    splash: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    banner: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    system_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    rules_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    public_updates_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    preferred_locale: UndefinedOr[Union[str, Locale]] = undefined.UNDEFINED,
    features: UndefinedOr[Sequence[GuildFeature]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> RESTGuild

Edit the guild.

PARAMETER DESCRIPTION
name

If provided, the new name for the guild.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

verification_level

If provided, the new verification level.

TYPE: UndefinedOr[GuildVerificationLevel] DEFAULT: UNDEFINED

default_message_notifications

If provided, the new default message notifications level.

TYPE: UndefinedOr[GuildMessageNotificationsLevel] DEFAULT: UNDEFINED

explicit_content_filter_level

If provided, the new explicit content filter level.

TYPE: UndefinedOr[GuildExplicitContentFilterLevel] DEFAULT: UNDEFINED

afk_channel

If provided, the new afk channel. Requires afk_timeout to be set to work.

TYPE: UndefinedOr[SnowflakeishOr[GuildVoiceChannel]] DEFAULT: UNDEFINED

afk_timeout

If provided, the new afk timeout.

TYPE: UndefinedOr[Intervalish] DEFAULT: UNDEFINED

icon

If provided, the new guild icon. Must be a 1024x1024 image or can be an animated gif when the guild has the hikari.guilds.GuildFeature.ANIMATED_ICON feature.

TYPE: UndefinedOr[Resourceish] DEFAULT: UNDEFINED

owner

If provided, the new guild owner.

Warning

You need to be the owner of the server to use this.

TYPE: hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishOr[hikari.users.PartialUser]]] DEFAULT: UNDEFINED

splash

If provided, the new guild splash. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.INVITE_SPLASH feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

banner

If provided, the new guild banner. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.BANNER feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

system_channel

If provided, the new system channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

rules_channel

If provided, the new rules channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

public_updates_channel

If provided, the new public updates channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

preferred_locale

If provided, the new preferred locale.

TYPE: UndefinedNoneOr[str] DEFAULT: UNDEFINED

features

If provided, the guild features to be enabled. Features not provided will be disabled.

TYPE: UndefinedOr[Sequence[GuildFeatures]] DEFAULT: UNDEFINED

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
RESTGuild

The edited guild.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value. Or you are missing the

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_GUILD permission or if you tried to pass ownership without being the server owner.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit_sticker async #

edit_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    tag: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Edit a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to edit. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
name

If provided, the new name for the sticker.

TYPE: UndefinedOr[str]

description

If provided, the new description for the sticker.

TYPE: UndefinedOr[str]

tag

If provided, the new sticker tag.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The edited sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_afk_channel async #

fetch_afk_channel() -> Optional[GuildVoiceChannel]

Fetch the channel that AFK voice users get sent to.

RETURNS DESCRIPTION
Optional[GuildVoiceChannel]

The AFK channel or None if not enabled.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emoji async #

Fetch an emoji from the guild.

PARAMETER DESCRIPTION
emoji

The emoji to fetch. This can be a hikari.emojis.CustomEmoji or the ID of an existing emoji.

TYPE: SnowflakeishOr[CustomEmoji]

RETURNS DESCRIPTION
KnownCustomEmoji

The requested emoji.

RAISES DESCRIPTION
NotFoundError

If the guild or the emoji are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emojis async #

fetch_emojis() -> Sequence[KnownCustomEmoji]

Fetch the emojis of the guild.

RETURNS DESCRIPTION
Sequence[KnownCustomEmoji]

The requested emojis.

RAISES DESCRIPTION
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_owner async #

fetch_owner() -> Member

Fetch the owner of the guild.

RETURNS DESCRIPTION
Member

The guild owner.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or the user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_public_updates_channel async #

fetch_public_updates_channel() -> Optional[GuildTextChannel]

Fetch channel ID of the channel where admins and moderators receive notices from Discord.

This is only present if hikari.guilds.GuildFeature.COMMUNITY is in hikari.guilds.Guild.features for this guild. For all other purposes, it should be considered to be None.

RETURNS DESCRIPTION
Optional[GuildTextChannel]

The channel where discord sends relevant updates to moderators and admins.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_roles async #

fetch_roles() -> Sequence[Role]

Fetch the roles of the guild.

RETURNS DESCRIPTION
Sequence[Role]

The requested roles.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_rules_channel async #

fetch_rules_channel() -> Optional[GuildTextChannel]

Fetch the channel where guilds display rules and guidelines.

If the hikari.guilds.GuildFeature.COMMUNITY feature is not defined, then this is None.

RETURNS DESCRIPTION
Optional[GuildTextChannel]

The channel where the rules of the guild are specified or else None.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_self async #

fetch_self() -> RESTGuild

Fetch the guild.

RETURNS DESCRIPTION
RESTGuild

The requested guild.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the guild.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_sticker async #

fetch_sticker(sticker: SnowflakeishOr[PartialSticker]) -> GuildSticker

Fetch a sticker from the guild.

PARAMETER DESCRIPTION
sticker

The sticker to fetch. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

RETURNS DESCRIPTION
GuildSticker

The requested sticker.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_stickers async #

fetch_stickers() -> Sequence[GuildSticker]

Fetch the stickers of the guild.

RETURNS DESCRIPTION
Sequence[GuildSticker]

The requested stickers.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_system_channel async #

fetch_system_channel() -> Optional[GuildTextChannel]

Fetch the system channel.

RETURNS DESCRIPTION
Optional[GuildTextChannel]

The system channel for this guild or None if not enabled.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_widget_channel async #

fetch_widget_channel() -> Optional[GuildChannel]

Fetch the widget channel.

This will be None if not set.

RETURNS DESCRIPTION
Optional[GuildChannel]

The channel the widget is linked to or else None.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

get_channel #

Get a cached channel that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
channel

The object or ID of the guild channel to get from the cache.

TYPE: SnowflakeishOr[PartialChannel]

RETURNS DESCRIPTION
Optional[GuildChannel]

The object of the guild channel found in cache or None.

get_channels #

Get the channels cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, GuildChannel]

A mapping of channel IDs to objects of the channels cached for the guild.

get_emoji #

Get a cached emoji that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
emoji

The object or ID of the emoji to get from the cache.

TYPE: SnowflakeishOr[CustomEmoji]

RETURNS DESCRIPTION
Optional[KnownCustomEmoji]

The object of the custom emoji if found in cache, else None.

get_emojis #

Return the emojis in this guild.

RETURNS DESCRIPTION
Mapping[Snowflake, KnownCustomEmoji]

A mapping of emoji IDs to the objects of emojis in this guild.

get_member #

get_member(user: SnowflakeishOr[PartialUser]) -> Optional[Member]

Get a cached member that belongs to the guild by it's user ID or object.

PARAMETER DESCRIPTION
user

The object or ID of the user to get the cached member for.

TYPE: SnowflakeishOr[PartialUser]

RETURNS DESCRIPTION
Optional[Member]

The cached member object if found, else None.

get_members #

get_members() -> Mapping[Snowflake, Member]

Get the members cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, Member]

A mapping of user IDs to objects of the members cached for the guild.

get_my_member #

get_my_member() -> Optional[Member]

Return the cached member for the bot user in this guild, if known.

RETURNS DESCRIPTION
Optional[Member]

The cached member for this guild, or None if not known.

get_presence #

Get a cached presence that belongs to the guild by it's user ID or object.

PARAMETER DESCRIPTION
user

The object or ID of the user to get the cached presence for.

TYPE: SnowflakeishOr[PartialUser]

RETURNS DESCRIPTION
Optional[MemberPresence]

The cached presence object if found, else None.

get_presences #

get_presences() -> Mapping[Snowflake, MemberPresence]

Get the presences cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, MemberPresence]

A mapping of user IDs to objects of the presences cached for the guild.

get_role #

get_role(role: SnowflakeishOr[PartialRole]) -> Optional[Role]

Get a cached role that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
role

The object or ID of the role to get for this guild from the cache.

TYPE: SnowflakeishOr[PartialRole]

RETURNS DESCRIPTION
Optional[Role]

The object of the role found in cache, else None.

get_roles #

get_roles() -> Mapping[Snowflake, Role]

Return the roles in this guild.

RETURNS DESCRIPTION
Mapping[Snowflake, Role]

A mapping of role IDs to the objects of roles in this guild.

get_sticker #

get_sticker(sticker: SnowflakeishOr[GuildSticker]) -> Optional[GuildSticker]

Get a cached sticker that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
sticker

The object or ID of the sticker to get from the cache.

TYPE: SnowflakeishOr[GuildSticker]

RETURNS DESCRIPTION
Optional[GuildSticker]

The object of the sticker if found in cache, else None.

get_stickers #

get_stickers() -> Mapping[Snowflake, GuildSticker]

Return the stickers in this guild.

RETURNS DESCRIPTION
Mapping[Snowflake, GuildSticker]

A mapping of sticker IDs to the objects of sticker in this guild.

get_voice_state #

get_voice_state(user: SnowflakeishOr[PartialUser]) -> Optional[VoiceState]

Get a cached voice state that belongs to the guild by it's user.

PARAMETER DESCRIPTION
user

The object or ID of the user to get the cached voice state for.

TYPE: SnowflakeishOr[PartialUser]

RETURNS DESCRIPTION
Optional[VoiceState]

The cached voice state object if found, else None.

get_voice_states #

get_voice_states() -> Mapping[Snowflake, VoiceState]

Get the voice states cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, VoiceState]

A mapping of user IDs to objects of the voice states cached for the guild.

kick async #

kick(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Kick the given user from this guild.

PARAMETER DESCRIPTION
user

The user to kick from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.KICK_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

make_banner_url #

make_banner_url(
    *, ext: Optional[str] = None, size: int = 4096
) -> Optional[URL]

Generate the guild's banner image URL, if set.

PARAMETER DESCRIPTION
ext

The ext to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the banner is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL of the banner, or None if no banner is set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_discovery_splash_url #

make_discovery_splash_url(
    *, ext: str = "png", size: int = 4096
) -> Optional[URL]

Generate the guild's discovery splash image URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL, defaults to png. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL, defaults to 4096. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The string URL.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_icon_url #

make_icon_url(*, ext: Optional[str] = None, size: int = 4096) -> Optional[URL]

Generate the guild's icon URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the icon is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the resource, or None if no icon is set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_splash_url #

make_splash_url(*, ext: str = 'png', size: int = 4096) -> Optional[URL]

Generate the guild's splash image URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL, defaults to png. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL, defaults to 4096. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the splash, or None if not set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

unban async #

unban(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Unban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to unban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

GuildBan #

Used to represent guild bans.

reason class-attribute instance-attribute #

reason: Optional[str] = field(repr=True)

The reason for this ban, will be None if no reason was given.

user class-attribute instance-attribute #

user: User = field(repr=True)

The object of the user this ban targets.

GuildExplicitContentFilterLevel #

Bases: int, Enum

Represents the explicit content filter setting for a guild.

ALL_MEMBERS class-attribute instance-attribute #

ALL_MEMBERS = 2

Filter all posts.

DISABLED class-attribute instance-attribute #

DISABLED = 0

No explicit content filter.

MEMBERS_WITHOUT_ROLES class-attribute instance-attribute #

MEMBERS_WITHOUT_ROLES = 1

Filter posts from anyone without a role.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

GuildFeature #

Bases: str, Enum

Features that a guild can provide.

ANIMATED_ICON class-attribute instance-attribute #

ANIMATED_ICON = 'ANIMATED_ICON'

Guild has access to set an animated guild icon.

BANNER class-attribute instance-attribute #

BANNER = 'BANNER'

Guild has access to set a guild banner image.

COMMERCE class-attribute instance-attribute #

COMMERCE = 'COMMERCE'

Guild has access to use commerce features (i.e. create store channels).

COMMUNITY class-attribute instance-attribute #

COMMUNITY = 'COMMUNITY'

Guild has community features enabled.

CREATOR_MONETIZABLE class-attribute instance-attribute #

CREATOR_MONETIZABLE = 'CREATOR_MONETIZABLE_PROVISIONAL'

Guild has enabled monetization.

CREATOR_STORE_PAGE class-attribute instance-attribute #

CREATOR_STORE_PAGE = 'CREATOR_STORE_PAGE'

Guild has enabled the store page.

DISCOVERABLE class-attribute instance-attribute #

DISCOVERABLE = 'DISCOVERABLE'

Guild is able to be discovered in the directory.

This also implies the guild can be viewed without joining.

FEATURABLE class-attribute instance-attribute #

FEATURABLE = 'FEATURABLE'

Guild is able to be featured in the directory.

INVITES_DISABLED class-attribute instance-attribute #

INVITES_DISABLED = 'INVITES_DISABLED'

Guild has paused invites, preventing new users from joining.

INVITE_SPLASH class-attribute instance-attribute #

INVITE_SPLASH = 'INVITE_SPLASH'

Guild has access to set an invite splash background.

MEMBER_VERIFICATION_GATE_ENABLED class-attribute instance-attribute #

MEMBER_VERIFICATION_GATE_ENABLED = 'MEMBER_VERIFICATION_GATE_ENABLED'

Guild has enabled Membership Screening.

MONETIZATION_ENABLED class-attribute instance-attribute #

MONETIZATION_ENABLED = 'MONETIZATION_ENABLED'

Guild has enabled monetization.

MORE_EMOJI class-attribute instance-attribute #

MORE_EMOJI = 'MORE_EMOJI'

More emojis can be hosted in this guild than normal.

MORE_STICKERS class-attribute instance-attribute #

MORE_STICKERS = 'MORE_STICKERS'

Guild has an increased custom stickers slots.

NEWS class-attribute instance-attribute #

NEWS = 'NEWS'

Guild has access to create news channels.

PARTNERED class-attribute instance-attribute #

PARTNERED = 'PARTNERED'

Guild is partnered.

PREVIEW_ENABLED class-attribute instance-attribute #

PREVIEW_ENABLED = 'PREVIEW_ENABLED'

Guild can be viewed before Membership Screening is complete.

RAID_ALERTS_DISABLED class-attribute instance-attribute #

RAID_ALERTS_DISABLED = 'RAID_ALERTS_DISABLED'

Guild has disabled alerts for join raids in the configured safety alerts channel.

RELAY_ENABLED class-attribute instance-attribute #

RELAY_ENABLED = 'RELAY_ENABLED'

Guild is using relays.

Relays are new infrastructure designed to handle large guilds more efficiently server-side.

ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE class-attribute instance-attribute #

ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE = (
    "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE"
)

Guild has role subscriptions available for purchase.

ROLE_SUBSCRIPTIONS_ENABLED class-attribute instance-attribute #

ROLE_SUBSCRIPTIONS_ENABLED = 'ROLE_SUBSCRIPTIONS_ENABLED'

Guild has enabled role subscriptions.

TICKETED_EVENTS_ENABLED class-attribute instance-attribute #

TICKETED_EVENTS_ENABLED = 'TICKETED_EVENTS_ENABLED'

Guild has enabled ticketed events.

VANITY_URL class-attribute instance-attribute #

VANITY_URL = 'VANITY_URL'

Guild has access to set a vanity URL.

VERIFIED class-attribute instance-attribute #

VERIFIED = 'VERIFIED'

Guild is verified.

VIP_REGIONS class-attribute instance-attribute #

VIP_REGIONS = 'VIP_REGIONS'

Guild has access to set 384kbps bitrate in voice.

Previously gave access to VIP voice servers.

WELCOME_SCREEN_ENABLED class-attribute instance-attribute #

WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED'

Guild has enabled the welcome screen.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

GuildMFALevel #

Bases: int, Enum

Represents the multi-factor authorization requirement for a guild.

ELEVATED class-attribute instance-attribute #

ELEVATED = 1

MFA requirement.

NONE class-attribute instance-attribute #

NONE = 0

No MFA requirement.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

GuildMessageNotificationsLevel #

Bases: int, Enum

Represents the default notification level for new messages in a guild.

ALL_MESSAGES class-attribute instance-attribute #

ALL_MESSAGES = 0

Notify users when any message is sent.

ONLY_MENTIONS class-attribute instance-attribute #

ONLY_MENTIONS = 1

Only notify users when they are @mentioned.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

GuildNSFWLevel #

Bases: int, Enum

Represents the NSFW level of a guild.

AGE_RESTRICTED class-attribute instance-attribute #

AGE_RESTRICTED = 3

Guild may contain NSFW content.

DEFAULT class-attribute instance-attribute #

DEFAULT = 0

Guild has not been categorized yet.

EXPLICIT class-attribute instance-attribute #

EXPLICIT = 1

Guild contains explicit NSFW content.

SAFE class-attribute instance-attribute #

SAFE = 2

Guild is safe of NSFW content.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

GuildPremiumTier #

Bases: int, Enum

Tier for Discord Nitro boosting in a guild.

NONE class-attribute instance-attribute #

NONE = 0

No Nitro boost level.

TIER_1 class-attribute instance-attribute #

TIER_1 = 1

Level 1 Nitro boost.

TIER_2 class-attribute instance-attribute #

TIER_2 = 2

Level 2 Nitro boost.

TIER_3 class-attribute instance-attribute #

TIER_3 = 3

Level 3 Nitro boost.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

GuildPreview #

Bases: PartialGuild

A preview of a guild with the hikari.guilds.GuildFeature.DISCOVERABLE feature.

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False, eq=False, hash=False, metadata={SKIP_DEEP_COPY: True}
)

Client application that models may use for procedures.

approximate_active_member_count class-attribute instance-attribute #

approximate_active_member_count: int = field(eq=False, hash=False, repr=True)

The approximate amount of presences in this guild.

approximate_member_count class-attribute instance-attribute #

approximate_member_count: int = field(eq=False, hash=False, repr=True)

The approximate amount of members in this guild.

created_at property #

created_at: datetime

When the object was created.

description class-attribute instance-attribute #

description: Optional[str] = field(eq=False, hash=False, repr=False)

The guild's description, if set.

discovery_splash_hash class-attribute instance-attribute #

discovery_splash_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash of the discovery splash for the guild, if there is one.

discovery_splash_url property #

discovery_splash_url: Optional[URL]

Discovery URL splash for the guild, if set.

emojis class-attribute instance-attribute #

emojis: Mapping[Snowflake, KnownCustomEmoji] = field(
    eq=False, hash=False, repr=False
)

The mapping of IDs to the emojis this guild provides.

features class-attribute instance-attribute #

features: Sequence[Union[str, GuildFeature]] = field(
    eq=False, hash=False, repr=False
)

A list of the features in this guild.

icon_hash class-attribute instance-attribute #

icon_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash for the guild icon, if there is one.

icon_url property #

icon_url: Optional[URL]

Icon URL for the guild, if set; otherwise None.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of the guild.

shard_id property #

shard_id: Optional[int]

Return the ID of the shard this guild is served by.

This may return None if the application does not have a gateway connection.

splash_hash class-attribute instance-attribute #

splash_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash of the splash for the guild, if there is one.

splash_url property #

splash_url: Optional[URL]

Splash URL for the guild, if set.

ban async #

ban(
    user: SnowflakeishOr[PartialUser],
    *,
    delete_message_seconds: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Ban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to ban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
delete_message_seconds

If provided, the number of seconds to delete messages for. This can be represented as either an int/float between 0 and 604800 (7 days), or a datetime.timedelta object.

TYPE: UndefinedNoneOr[Intervalish]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_category async #

create_category(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildCategory

Create a category in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildCategory

The created category.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_forum_channel async #

create_forum_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    default_auto_archive_duration: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_thread_rate_limit_per_user: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_forum_layout: UndefinedOr[
        Union[ForumLayoutType, int]
    ] = undefined.UNDEFINED,
    default_sort_order: UndefinedOr[
        Union[ForumSortOrderType, int]
    ] = undefined.UNDEFINED,
    available_tags: UndefinedOr[Sequence[ForumTag]] = undefined.UNDEFINED,
    default_reaction_emoji: Union[
        str, Emoji, UndefinedType, Snowflake
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildForumChannel

Create a forum channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

default_auto_archive_duration

If provided, the auto archive duration Discord's end user client should default to when creating threads in this channel.

This should be either 60, 1440, 4320 or 10080 minutes and, as of writing, ignores the parent channel's set default_auto_archive_duration when passed as hikari.undefined.UNDEFINED.

TYPE: UndefinedOr[Intervalish]

default_thread_rate_limit_per_user

If provided, the ratelimit that should be set in threads created from the forum.

TYPE: UndefinedOr[Intervalish]

default_forum_layout

If provided, the default forum layout to show in the client.

TYPE: UndefinedOr[Union[ForumLayoutType, int]]

default_sort_order

If provided, the default sort order to show in the client.

TYPE: UndefinedOr[Union[ForumSortOrderType, int]]

available_tags

If provided, the available tags to select from when creating a thread.

TYPE: UndefinedOr[Sequence[ForumTag]]

default_reaction_emoji

If provided, the new default reaction emoji for threads created in a forum channel.

TYPE: Union[str, Emoji, UndefinedType, Snowflake]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildForumChannel

The created forum channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_news_channel async #

create_news_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildNewsChannel

Create a news channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildNewsChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_stage_channel async #

create_stage_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildStageChannel

Create a stage channel in the guild.

PARAMETER DESCRIPTION
name

The channel's name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildStageChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_sticker async #

create_sticker(
    name: str,
    tag: str,
    image: Resourceish,
    *,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Create a sticker in a guild.

Note

Lottie support is only available for verified and partnered servers.

PARAMETER DESCRIPTION
name

The name for the sticker.

TYPE: str

tag

The tag for the sticker.

TYPE: str

image

The 320x320 image for the sticker. Maximum upload size is 500kb. This can be a still PNG, an animated PNG, a Lottie, or a GIF.

TYPE: Resourceish

PARAMETER DESCRIPTION
description

If provided, the description of the sticker.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The created sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value or if there are no more spaces for the sticker in the guild.

ForbiddenError
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_text_channel async #

create_text_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildTextChannel

Create a text channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildTextChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_voice_channel async #

create_voice_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    video_quality_mode: UndefinedOr[
        Union[VideoQualityMode, int]
    ] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildVoiceChannel

Create a voice channel in a guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

video_quality_mode

If provided, the new video quality mode for the channel.

TYPE: UndefinedOr[Union[VideoQualityMode, int]]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildVoiceChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the gui ld is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_channel async #

delete_channel(channel: SnowflakeishOr[GuildChannel]) -> GuildChannel

Delete a channel in the guild.

Note

This method can also be used for deleting guild categories as well.

Note

For Public servers, the set 'Rules' or 'Guidelines' channels and the 'Public Server Updates' channel cannot be deleted.

PARAMETER DESCRIPTION
channel

The channel or category to delete. This may be the object or the ID of an existing channel.

TYPE: SnowflakeishOr[GuildChannel]

RETURNS DESCRIPTION
GuildChannel

Object of the channel or category that was deleted.

RAISES DESCRIPTION
hikari.errors.UnauthorizedError, or close a DM.

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_sticker async #

delete_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Delete a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to delete. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit async #

edit(
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    verification_level: UndefinedOr[
        GuildVerificationLevel
    ] = undefined.UNDEFINED,
    default_message_notifications: UndefinedOr[
        GuildMessageNotificationsLevel
    ] = undefined.UNDEFINED,
    explicit_content_filter_level: UndefinedOr[
        GuildExplicitContentFilterLevel
    ] = undefined.UNDEFINED,
    afk_channel: UndefinedOr[
        SnowflakeishOr[GuildVoiceChannel]
    ] = undefined.UNDEFINED,
    afk_timeout: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    icon: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    owner: UndefinedOr[SnowflakeishOr[PartialUser]] = undefined.UNDEFINED,
    splash: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    banner: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    system_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    rules_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    public_updates_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    preferred_locale: UndefinedOr[Union[str, Locale]] = undefined.UNDEFINED,
    features: UndefinedOr[Sequence[GuildFeature]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> RESTGuild

Edit the guild.

PARAMETER DESCRIPTION
name

If provided, the new name for the guild.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

verification_level

If provided, the new verification level.

TYPE: UndefinedOr[GuildVerificationLevel] DEFAULT: UNDEFINED

default_message_notifications

If provided, the new default message notifications level.

TYPE: UndefinedOr[GuildMessageNotificationsLevel] DEFAULT: UNDEFINED

explicit_content_filter_level

If provided, the new explicit content filter level.

TYPE: UndefinedOr[GuildExplicitContentFilterLevel] DEFAULT: UNDEFINED

afk_channel

If provided, the new afk channel. Requires afk_timeout to be set to work.

TYPE: UndefinedOr[SnowflakeishOr[GuildVoiceChannel]] DEFAULT: UNDEFINED

afk_timeout

If provided, the new afk timeout.

TYPE: UndefinedOr[Intervalish] DEFAULT: UNDEFINED

icon

If provided, the new guild icon. Must be a 1024x1024 image or can be an animated gif when the guild has the hikari.guilds.GuildFeature.ANIMATED_ICON feature.

TYPE: UndefinedOr[Resourceish] DEFAULT: UNDEFINED

owner

If provided, the new guild owner.

Warning

You need to be the owner of the server to use this.

TYPE: hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishOr[hikari.users.PartialUser]]] DEFAULT: UNDEFINED

splash

If provided, the new guild splash. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.INVITE_SPLASH feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

banner

If provided, the new guild banner. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.BANNER feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

system_channel

If provided, the new system channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

rules_channel

If provided, the new rules channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

public_updates_channel

If provided, the new public updates channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

preferred_locale

If provided, the new preferred locale.

TYPE: UndefinedNoneOr[str] DEFAULT: UNDEFINED

features

If provided, the guild features to be enabled. Features not provided will be disabled.

TYPE: UndefinedOr[Sequence[GuildFeatures]] DEFAULT: UNDEFINED

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
RESTGuild

The edited guild.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value. Or you are missing the

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_GUILD permission or if you tried to pass ownership without being the server owner.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit_sticker async #

edit_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    tag: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Edit a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to edit. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
name

If provided, the new name for the sticker.

TYPE: UndefinedOr[str]

description

If provided, the new description for the sticker.

TYPE: UndefinedOr[str]

tag

If provided, the new sticker tag.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The edited sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emoji async #

Fetch an emoji from the guild.

PARAMETER DESCRIPTION
emoji

The emoji to fetch. This can be a hikari.emojis.CustomEmoji or the ID of an existing emoji.

TYPE: SnowflakeishOr[CustomEmoji]

RETURNS DESCRIPTION
KnownCustomEmoji

The requested emoji.

RAISES DESCRIPTION
NotFoundError

If the guild or the emoji are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emojis async #

fetch_emojis() -> Sequence[KnownCustomEmoji]

Fetch the emojis of the guild.

RETURNS DESCRIPTION
Sequence[KnownCustomEmoji]

The requested emojis.

RAISES DESCRIPTION
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_roles async #

fetch_roles() -> Sequence[Role]

Fetch the roles of the guild.

RETURNS DESCRIPTION
Sequence[Role]

The requested roles.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_self async #

fetch_self() -> RESTGuild

Fetch the guild.

RETURNS DESCRIPTION
RESTGuild

The requested guild.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the guild.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_sticker async #

fetch_sticker(sticker: SnowflakeishOr[PartialSticker]) -> GuildSticker

Fetch a sticker from the guild.

PARAMETER DESCRIPTION
sticker

The sticker to fetch. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

RETURNS DESCRIPTION
GuildSticker

The requested sticker.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_stickers async #

fetch_stickers() -> Sequence[GuildSticker]

Fetch the stickers of the guild.

RETURNS DESCRIPTION
Sequence[GuildSticker]

The requested stickers.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

kick async #

kick(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Kick the given user from this guild.

PARAMETER DESCRIPTION
user

The user to kick from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.KICK_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

make_discovery_splash_url #

make_discovery_splash_url(
    *, ext: str = "png", size: int = 4096
) -> Optional[URL]

Generate the guild's discovery splash image URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The string URL.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_icon_url #

make_icon_url(*, ext: Optional[str] = None, size: int = 4096) -> Optional[URL]

Generate the guild's icon URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the icon is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the resource, or None if no icon is set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_splash_url #

make_splash_url(*, ext: str = 'png', size: int = 4096) -> Optional[URL]

Generate the guild's splash image URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the splash, or None if not set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

unban async #

unban(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Unban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to unban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

GuildSystemChannelFlag #

Bases: Flag

Defines which features are suppressed in the system channel.

NONE class-attribute instance-attribute #

NONE = 0

Nothing is suppressed.

SUPPRESS_GUILD_REMINDER class-attribute instance-attribute #

SUPPRESS_GUILD_REMINDER = 1 << 2

Suppress displaying messages with guild setup tips.

SUPPRESS_PREMIUM_SUBSCRIPTION class-attribute instance-attribute #

SUPPRESS_PREMIUM_SUBSCRIPTION = 1 << 1

Suppress displaying a message when the guild is Nitro boosted.

SUPPRESS_USER_JOIN class-attribute instance-attribute #

SUPPRESS_USER_JOIN = 1 << 0

Suppress displaying a message about new users joining.

SUPPRESS_USER_JOIN_REPLIES class-attribute instance-attribute #

SUPPRESS_USER_JOIN_REPLIES = 1 << 3

Suppress displaying a reply button on join notifications.

name property #

name: str

Return the name of the flag combination as a str.

value property #

value: int

Return the int value of the flag.

all #

all(*flags: Self) -> bool

Check if all of the given flags are part of this value.

RETURNS DESCRIPTION
bool

True if any of the given flags are part of this value. Otherwise, return False.

any #

any(*flags: Self) -> bool

Check if any of the given flags are part of this value.

RETURNS DESCRIPTION
bool

True if any of the given flags are part of this value. Otherwise, return False.

difference #

difference(other: Union[int, Self]) -> Self

Perform a set difference with the other set.

This will return all flags in this set that are not in the other value.

Equivalent to using the subtraction - operator.

intersection #

intersection(other: Union[int, Self]) -> Self

Return a combination of flags that are set for both given values.

Equivalent to using the "AND" & operator.

invert #

invert() -> Self

Return a set of all flags not in the current set.

is_disjoint #

is_disjoint(other: Union[int, Self]) -> bool

Return whether two sets have a intersection or not.

If the two sets have an intersection, then this returns False. If no common flag values exist between them, then this returns True.

is_subset #

is_subset(other: Union[int, Self]) -> bool

Return whether another set contains this set or not.

Equivalent to using the "in" operator.

is_superset #

is_superset(other: Union[int, Self]) -> bool

Return whether this set contains another set or not.

none #

none(*flags: Self) -> bool

Check if none of the given flags are part of this value.

Note

This is essentially the opposite of hikari.internal.enums.Flag.any.

RETURNS DESCRIPTION
bool

True if none of the given flags are part of this value. Otherwise, return False.

split #

split() -> Sequence[Self]

Return a list of all defined atomic values for this flag.

Any unrecognised bits will be omitted for brevity.

The result will be a name-sorted typing.Sequence of each member

symmetric_difference #

symmetric_difference(other: Union[int, Self]) -> Self

Return a set with the symmetric differences of two flag sets.

Equivalent to using the "XOR" ^ operator.

For a ^ b, this can be considered the same as (a - b) | (b - a).

union #

union(other: Union[int, Self]) -> Self

Return a combination of all flags in this set and the other set.

Equivalent to using the "OR" ~ operator.

GuildVerificationLevel #

Bases: int, Enum

Represents the level of verification of a guild.

HIGH class-attribute instance-attribute #

HIGH = 3

Must also be a member of the guild for longer than 10 minutes.

LOW class-attribute instance-attribute #

LOW = 1

Must have a verified email on their account.

MEDIUM class-attribute instance-attribute #

MEDIUM = 2

Must have been registered on Discord for more than 5 minutes.

NONE class-attribute instance-attribute #

NONE = 0

Unrestricted.

VERY_HIGH class-attribute instance-attribute #

VERY_HIGH = 4

Must have a verified phone number.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

GuildWidget #

Represents a guild widget.

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False, eq=False, hash=False, metadata={SKIP_DEEP_COPY: True}
)

Client application that models may use for procedures.

channel_id class-attribute instance-attribute #

channel_id: Optional[Snowflake] = field(repr=True)

The ID of the channel the invite for this embed targets, if enabled.

is_enabled class-attribute instance-attribute #

is_enabled: bool = field(repr=True)

Whether this embed is enabled.

fetch_channel async #

fetch_channel() -> Optional[GuildChannel]

Fetch the widget channel.

This will be None if not set.

RETURNS DESCRIPTION
Optional[GuildChannel]

The requested channel.

You can check the type of the channel by using isinstance.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

Integration #

Bases: PartialIntegration

Represents a guild integration object.

account class-attribute instance-attribute #

account: IntegrationAccount = field(eq=False, hash=False, repr=False)

The account connected to this integration.

application class-attribute instance-attribute #

application: Optional[IntegrationApplication] = field(
    eq=False, hash=False, repr=False
)

The bot/OAuth2 application associated with this integration.

Note

This is only available for Discord integrations.

created_at property #

created_at: datetime

When the object was created.

expire_behavior class-attribute instance-attribute #

expire_behavior: Union[IntegrationExpireBehaviour, int, None] = field(
    eq=False, hash=False, repr=False
)

How members should be treated after their connected subscription expires.

This will not be enacted until after GuildIntegration.expire_grace_period passes.

Note

This will always be None for Discord integrations.

expire_grace_period class-attribute instance-attribute #

expire_grace_period: Optional[timedelta] = field(
    eq=False, hash=False, repr=False
)

How many days users with expired subscriptions are given until the expire behavior is enacted out on them.

Note

This will always be None for Discord integrations.

guild_id class-attribute instance-attribute #

guild_id: Snowflake = field()

The ID of the guild this integration belongs to.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

is_emojis_enabled class-attribute instance-attribute #

is_emojis_enabled: Optional[bool] = field(eq=False, hash=False, repr=False)

Whether users under this integration are allowed to use it's custom emojis.

is_enabled class-attribute instance-attribute #

is_enabled: bool = field(eq=False, hash=False, repr=True)

Whether this integration is enabled.

is_revoked class-attribute instance-attribute #

is_revoked: Optional[bool] = field(eq=False, hash=False, repr=False)

Whether the integration has been revoked.

is_syncing class-attribute instance-attribute #

is_syncing: Optional[bool] = field(eq=False, hash=False, repr=False)

Whether this integration is syncing subscribers/emojis.

last_synced_at class-attribute instance-attribute #

last_synced_at: Optional[datetime] = field(eq=False, hash=False, repr=False)

The datetime of when this integration's subscribers were last synced.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of this integration.

role_id class-attribute instance-attribute #

role_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the managed role used for this integration's subscribers.

subscriber_count class-attribute instance-attribute #

subscriber_count: Optional[int] = field(eq=False, hash=False, repr=False)

The number of subscribers this integration has.

type class-attribute instance-attribute #

type: Union[IntegrationType, str] = field(eq=False, hash=False, repr=True)

The type of this integration.

user class-attribute instance-attribute #

user: Optional[User] = field(eq=False, hash=False, repr=False)

The user this integration belongs to.

IntegrationAccount #

An account that's linked to an integration.

id class-attribute instance-attribute #

id: str = field(hash=True, repr=True)

The string ID of this (likely) third party account.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of this account.

IntegrationApplication #

Bases: PartialApplication

An application that's linked to an integration.

bot class-attribute instance-attribute #

bot: Optional[User] = field(eq=False, hash=False, repr=False)

The bot associated with this application.

created_at property #

created_at: datetime

When the object was created.

description class-attribute instance-attribute #

description: Optional[str] = field(eq=False, hash=False, repr=False)

The description of this application, if any.

icon_hash class-attribute instance-attribute #

icon_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The CDN hash of this application's icon, if set.

icon_url property #

icon_url: Optional[URL]

Team icon URL, if there is one.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of this application.

make_icon_url #

make_icon_url(*, ext: str = 'png', size: int = 4096) -> Optional[URL]

Generate the icon URL for this application.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL, or None if no icon exists.

RAISES DESCRIPTION
ValueError

If the size is not an integer power of 2 between 16 and 4096 (inclusive).

IntegrationExpireBehaviour #

Bases: int, Enum

Behavior for expiring integration subscribers.

KICK class-attribute instance-attribute #

KICK = 1

Kick the subscriber.

REMOVE_ROLE class-attribute instance-attribute #

REMOVE_ROLE = 0

Remove the role.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

IntegrationType #

Bases: str, Enum

The integration type.

DISCORD_BOT class-attribute instance-attribute #

DISCORD_BOT = 'discord'

Discord bot.

GUILD_SUBSCRIPTION class-attribute instance-attribute #

GUILD_SUBSCRIPTION = 'guild_subscription'

Guild subscription.

TWITCH class-attribute instance-attribute #

TWITCH = 'twitch'

Twitch.

YOUTUBE class-attribute instance-attribute #

YOUTUBE = 'youtube'

Youtube.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

Member #

Bases: User

Used to represent a guild bound member.

accent_color property #

accent_color: Optional[Color]

The custom banner color for the user, if set else None.

The official client will decide the default color if not set.

accent_colour property #

accent_colour: Optional[Color]

Alias for the hikari.users.User.accent_color field.

app property #

app: RESTAware

Return the app that is bound to the user object.

avatar_hash property #

avatar_hash: Optional[str]

Avatar hash for the user, if they have one, otherwise None.

avatar_url property #

avatar_url: Optional[URL]

Avatar URL for the user, if they have one set.

May be None if no custom avatar is set. In this case, you should use hikari.User.default_avatar_url instead.

banner_hash property #

banner_hash: Optional[str]

Banner hash for the user, if they have one, otherwise None.

banner_url property #

banner_url: Optional[URL]

Banner URL for the user, if they have one set.

May be None if no custom banner is set.

created_at property #

created_at: datetime

When the object was created.

default_avatar_url property #

default_avatar_url: URL

Default avatar URL for this user.

discriminator property #

discriminator: str

Discriminator for the user.

!!! deprecated 2.0.0.dev120 Discriminators are deprecated and being replaced with "0" by Discord during username migration. This field will be removed after migration is complete. Learn more here: https://dis.gd/usernames

display_avatar_url property #

display_avatar_url: URL

Display avatar URL for this user.

display_name property #

display_name: str

Return the member's display name.

If the member has a nickname, this will return that nickname. If the user has a global name, this will return that global name. If the user has neither, the username will be returned instead.

See Also

flags property #

flags: UserFlag

Flag bits that are set for the user.

global_name property #

global_name: Optional[str]

Global name for the user, if they have one, otherwise None.

guild_avatar_hash class-attribute instance-attribute #

guild_avatar_hash: Optional[str] = field(eq=False, hash=False, repr=False)

Hash of the member's guild avatar guild if set, else None.

Note

This takes precedence over hikari.guilds.Member.avatar_hash.

guild_avatar_url property #

guild_avatar_url: Optional[URL]

Guild Avatar URL for the user, if they have one set.

May be None if no guild avatar is set. In this case, you should use hikari.guilds.Member.avatar_hash or hikari.guilds.Member.default_avatar_url instead.

guild_id class-attribute instance-attribute #

guild_id: Snowflake = field(repr=True)

The ID of the guild this member belongs to.

id property #

ID of this entity.

is_bot property #

is_bot: bool

Whether this user is a bot account.

is_deaf class-attribute instance-attribute #

is_deaf: UndefinedOr[bool] = field(repr=False)

True if this member is deafened in the current voice channel.

This will be hikari.undefined.UNDEFINED if it's state is unknown.

is_mute class-attribute instance-attribute #

is_mute: UndefinedOr[bool] = field(repr=False)

True if this member is muted in the current voice channel.

This will be hikari.undefined.UNDEFINED if it's state is unknown.

is_pending class-attribute instance-attribute #

is_pending: UndefinedOr[bool] = field(repr=False)

Whether the user has passed the guild's membership screening requirements.

This will be hikari.undefined.UNDEFINED if it's state is unknown.

is_system property #

is_system: bool

Whether this user is a system account.

joined_at class-attribute instance-attribute #

joined_at: Optional[datetime] = field(repr=True)

The datetime of when this member joined the guild they belong to.

This will be None for guest members that have been temporarily invited.

mention property #

mention: str

Return a raw mention string for the given user.

Examples:

    >>> some_user.mention
    '<@123456789123456789>'

nickname class-attribute instance-attribute #

nickname: Optional[str] = field(repr=True)

This member's nickname.

This will be None if not set.

premium_since class-attribute instance-attribute #

premium_since: Optional[datetime] = field(repr=False)

The datetime of when this member started "boosting" this guild.

Will be None if the member is not a premium user.

raw_communication_disabled_until class-attribute instance-attribute #

raw_communication_disabled_until: Optional[datetime] = field(repr=False)

The datetime when this member's timeout will expire.

Will be None if the member is not timed out.

Note

The datetime might be in the past, so it is recommended to use hikari.guilds.Member.communication_disabled_until method to check if the member is timed out at the time of the call.

role_ids class-attribute instance-attribute #

role_ids: Sequence[Snowflake] = field(repr=False)

A sequence of the IDs of the member's current roles.

user class-attribute instance-attribute #

user: User = field(repr=True)

This member's corresponding user object.

username property #

username: str

Username for the user.

add_role async #

add_role(
    role: SnowflakeishOr[PartialRole],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Add a role to the member.

PARAMETER DESCRIPTION
role

The role to add. This may be the object or the ID of an existing role.

TYPE: SnowflakeishOr[PartialRole]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_ROLES permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild, user or role are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

ban async #

ban(
    *,
    delete_message_seconds: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Ban this member from this guild.

PARAMETER DESCRIPTION
delete_message_seconds

If provided, the number of seconds to delete messages for. This can be represented as either an int/float between 0 and 604800 (7 days), or a datetime.timedelta object.

TYPE: UndefinedNoneOr[Intervalish]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

communication_disabled_until #

communication_disabled_until() -> Optional[datetime]

Return when the timeout for this member ends.

Unlike raw_communication_disabled_until, this will always be None if the member is not currently timed out.

Note

The output of this function can depend based on when the function is called.

edit async #

edit(
    *,
    nickname: UndefinedNoneOr[str] = undefined.UNDEFINED,
    roles: UndefinedOr[SnowflakeishSequence[PartialRole]] = undefined.UNDEFINED,
    mute: UndefinedOr[bool] = undefined.UNDEFINED,
    deaf: UndefinedOr[bool] = undefined.UNDEFINED,
    voice_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildVoiceChannel]
    ] = undefined.UNDEFINED,
    communication_disabled_until: UndefinedNoneOr[
        datetime
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> Member

Edit the member.

PARAMETER DESCRIPTION
nickname

If provided, the new nick for the member. If None, will remove the members nick.

Requires the hikari.permissions.Permissions.MANAGE_NICKNAMES permission.

TYPE: UndefinedNoneOr[str]

roles

If provided, the new roles for the member.

Requires the hikari.permissions.Permissions.MANAGE_ROLES permission.

TYPE: UndefinedOr[SnowflakeishSequence[PartialRole]]

mute

If provided, the new server mute state for the member.

Requires the hikari.permissions.Permissions.MUTE_MEMBERS permission.

TYPE: UndefinedOr[bool]

deaf

If provided, the new server deaf state for the member.

Requires the hikari.permissions.Permissions.DEAFEN_MEMBERS permission.

TYPE: UndefinedOr[bool]

voice_channel

If provided, None or the object or the ID of an existing voice channel to move the member to. If None, will disconnect the member from voice.

Requires the hikari.permissions.Permissions.MOVE_MEMBERS permission and the hikari.permissions.Permissions.CONNECT permission in the original voice channel and the target voice channel.

Note

If the member is not in a voice channel, this will take no effect.

TYPE: hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishOr[hikari.channels.GuildVoiceChannel]]]

communication_disabled_until

If provided, the datetime when the timeout (disable communication) of the member expires, up to 28 days in the future, or None to remove the timeout from the member.

Requires the hikari.permissions.Permissions.MODERATE_MEMBERS permission.

TYPE: UndefinedNoneOr[datetime]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
Member

Object of the member that was updated.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing a permission to do an action.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or the user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_dm_channel async #

fetch_dm_channel() -> DMChannel

Fetch the DM channel for this user.

RETURNS DESCRIPTION
DMChannel

The requested channel.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the user is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_roles async #

fetch_roles() -> Sequence[Role]

Fetch an up-to-date view of this member's roles from the API.

RETURNS DESCRIPTION
Sequence[Role]

An up-to-date view of this member's roles.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the member is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_self async #

fetch_self() -> Member

Fetch an up-to-date view of this member from the API.

RETURNS DESCRIPTION
Member

An up-to-date view of this member.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the member is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

get_guild #

get_guild() -> Optional[Guild]

Return the guild associated with this member.

RETURNS DESCRIPTION
Optional[Guild]

The linked guild object or None if it's not cached.

get_presence #

get_presence() -> Optional[MemberPresence]

Get the cached presence for this member, if known.

Presence info includes user status and activities.

This requires the hikari.intents.Intents.GUILD_PRESENCES intent to be enabled.

RETURNS DESCRIPTION
Optional[MemberPresence]

The member presence, or None if not known.

get_roles #

get_roles() -> Sequence[Role]

Return the roles the user has.

This will be empty if the roles are missing from the cache.

RETURNS DESCRIPTION
Sequence[Role]

The roles the users has.

get_top_role #

get_top_role() -> Optional[Role]

Return the highest role the member has.

RETURNS DESCRIPTION
Optional[Role]

None if the cache is missing the roles information or the highest role the user has.

kick async #

kick(*, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None

Kick this member from this guild.

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.KICK_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

make_avatar_url #

make_avatar_url(
    *, ext: Optional[str] = None, size: int = 4096
) -> Optional[URL]

Generate the avatar URL for this user, if set.

If no custom avatar is set, this returns None. You can then use the hikari.User.default_avatar_url attribute instead to fetch the displayed URL.

PARAMETER DESCRIPTION
ext

The ext to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated). Will be ignored for default avatars which can only be png.

If None, then the correct default extension is determined based on whether the icon is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096. Will be ignored for default avatars.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the avatar, or None if not present.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_banner_url #

make_banner_url(
    *, ext: Optional[str] = None, size: int = 4096
) -> Optional[URL]

Generate the banner URL for this user, if set.

If no custom banner is set, this returns None.

PARAMETER DESCRIPTION
ext

The ext to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the banner is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the banner, or None if not present.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_guild_avatar_url #

make_guild_avatar_url(
    *, ext: Optional[str] = None, size: int = 4096
) -> Optional[URL]

Generate the guild specific avatar url for this member, if set.

If no guild avatar is set, this returns None.

PARAMETER DESCRIPTION
ext

The ext to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

Will be ignored for default avatars which can only be png.

If None, then the correct default extension is determined based on whether the icon is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096. Will be ignored for default avatars.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the avatar, or None if not present.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

remove_role async #

remove_role(
    role: SnowflakeishOr[PartialRole],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Remove a role from the member.

PARAMETER DESCRIPTION
role

The role to remove. This may be the object or the ID of an existing role.

TYPE: SnowflakeishOr[PartialRole]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_ROLES permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild, user or role are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

send async #

send(
    content: UndefinedOr[Any] = undefined.UNDEFINED,
    *,
    attachment: UndefinedOr[Resourceish] = undefined.UNDEFINED,
    attachments: UndefinedOr[Sequence[Resourceish]] = undefined.UNDEFINED,
    component: UndefinedOr[ComponentBuilder] = undefined.UNDEFINED,
    components: UndefinedOr[Sequence[ComponentBuilder]] = undefined.UNDEFINED,
    embed: UndefinedOr[Embed] = undefined.UNDEFINED,
    embeds: UndefinedOr[Sequence[Embed]] = undefined.UNDEFINED,
    tts: UndefinedOr[bool] = undefined.UNDEFINED,
    reply: UndefinedOr[SnowflakeishOr[PartialMessage]] = undefined.UNDEFINED,
    reply_must_exist: UndefinedOr[bool] = undefined.UNDEFINED,
    mentions_everyone: UndefinedOr[bool] = undefined.UNDEFINED,
    mentions_reply: UndefinedOr[bool] = undefined.UNDEFINED,
    user_mentions: UndefinedOr[
        Union[SnowflakeishSequence[PartialUser], bool]
    ] = undefined.UNDEFINED,
    role_mentions: UndefinedOr[
        Union[SnowflakeishSequence[PartialRole], bool]
    ] = undefined.UNDEFINED,
    flags: Union[UndefinedType, int, MessageFlag] = undefined.UNDEFINED
) -> Message

Send a message to this user in DM's.

PARAMETER DESCRIPTION
content

If provided, the message contents. If hikari.undefined.UNDEFINED, then nothing will be sent in the content. Any other value here will be cast to a str.

If this is a hikari.embeds.Embed and no embed nor embeds kwarg is provided, then this will instead update the embed. This allows for simpler syntax when sending an embed alone.

Likewise, if this is a hikari.files.Resource, then the content is instead treated as an attachment if no attachment and no attachments kwargs are provided.

TYPE: UndefinedOr[Any] DEFAULT: UNDEFINED

PARAMETER DESCRIPTION
attachment

If provided, the message attachment. This can be a resource, or string of a path on your computer or a URL.

Attachments can be passed as many different things, to aid in convenience.

TYPE: UndefinedOr[Resourceish]

attachments

If provided, the message attachments. These can be resources, or strings consisting of paths on your computer or URLs.

TYPE: UndefinedOr[Sequence[Resourceish]]

component

If provided, builder object of the component to include in this message.

TYPE: UndefinedOr[ComponentBuilder]

components

If provided, a sequence of the component builder objects to include in this message.

TYPE: UndefinedOr[Sequence[ComponentBuilder]]

embed

If provided, the message embed.

TYPE: UndefinedOr[Embed]

embeds

If provided, the message embeds.

TYPE: UndefinedOr[Sequence[Embed]]

tts

If provided, whether the message will be read out by a screen reader using Discord's TTS (text-to-speech) system.

TYPE: UndefinedOr[bool]

reply

If provided, the message to reply to.

TYPE: UndefinedOr[SnowflakeishOr[PartialMessage]]

reply_must_exist

If provided, whether to error if the message being replied to does not exist instead of sending as a normal (non-reply) message.

This will not do anything if not being used with reply.

TYPE: UndefinedOr[bool]

mentions_everyone

If provided, whether the message should parse @everyone/@here mentions.

TYPE: UndefinedOr[bool]

mentions_reply

If provided, whether to mention the author of the message that is being replied to.

This will not do anything if not being used with reply.

TYPE: UndefinedOr[bool]

user_mentions

If provided, and True, all user mentions will be detected. If provided, and False, all user mentions will be ignored if appearing in the message body. Alternatively this may be a collection of hikari.snowflakes.Snowflake, or hikari.users.PartialUser derivatives to enforce mentioning specific users.

TYPE: UndefinedOr[Union[SnowflakeishSequence[PartialUser], bool]]

role_mentions

If provided, and True, all role mentions will be detected. If provided, and False, all role mentions will be ignored if appearing in the message body. Alternatively this may be a collection of hikari.snowflakes.Snowflake, or hikari.guilds.PartialRole derivatives to enforce mentioning specific roles.

TYPE: UndefinedOr[Union[SnowflakeishSequence[PartialRole], bool]]

flags

If provided, optional flags to set on the message. If hikari.undefined.UNDEFINED, then nothing is changed.

Note that some flags may not be able to be set. Currently the only flags that can be set are hikari.messages.MessageFlag.NONE and hikari.messages.MessageFlag.SUPPRESS_EMBEDS.

TYPE: UndefinedOr[MessageFlag]

RETURNS DESCRIPTION
Message

The created message.

RAISES DESCRIPTION
ValueError

If more than 100 unique objects/entities are passed for role_mentions or user_mentions.

TypeError

If both attachment and attachments are specified.

BadRequestError

This may be raised in several discrete situations, such as messages being empty with no attachments or embeds; messages with more than 2000 characters in them, embeds that exceed one of the many embed limits; too many attachments; attachments that are too large; invalid image URLs in embeds; reply not found or not in the same channel; too many components.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.SEND_MESSAGES in the channel or the person you are trying to message has the DM's disabled.

NotFoundError

If the user is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

unban async #

unban(*, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None

Unban this member from the guild.

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

PartialApplication #

Bases: Unique

A partial representation of a Discord application.

created_at property #

created_at: datetime

When the object was created.

description class-attribute instance-attribute #

description: Optional[str] = field(eq=False, hash=False, repr=False)

The description of this application, if any.

icon_hash class-attribute instance-attribute #

icon_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The CDN hash of this application's icon, if set.

icon_url property #

icon_url: Optional[URL]

Team icon URL, if there is one.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of this application.

make_icon_url #

make_icon_url(*, ext: str = 'png', size: int = 4096) -> Optional[URL]

Generate the icon URL for this application.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL, or None if no icon exists.

RAISES DESCRIPTION
ValueError

If the size is not an integer power of 2 between 16 and 4096 (inclusive).

PartialGuild #

Bases: Unique

Base object for any partial guild objects.

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False, eq=False, hash=False, metadata={SKIP_DEEP_COPY: True}
)

Client application that models may use for procedures.

created_at property #

created_at: datetime

When the object was created.

icon_hash class-attribute instance-attribute #

icon_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash for the guild icon, if there is one.

icon_url property #

icon_url: Optional[URL]

Icon URL for the guild, if set; otherwise None.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of the guild.

shard_id property #

shard_id: Optional[int]

Return the ID of the shard this guild is served by.

This may return None if the application does not have a gateway connection.

ban async #

ban(
    user: SnowflakeishOr[PartialUser],
    *,
    delete_message_seconds: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Ban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to ban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
delete_message_seconds

If provided, the number of seconds to delete messages for. This can be represented as either an int/float between 0 and 604800 (7 days), or a datetime.timedelta object.

TYPE: UndefinedNoneOr[Intervalish]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_category async #

create_category(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildCategory

Create a category in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildCategory

The created category.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_forum_channel async #

create_forum_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    default_auto_archive_duration: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_thread_rate_limit_per_user: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_forum_layout: UndefinedOr[
        Union[ForumLayoutType, int]
    ] = undefined.UNDEFINED,
    default_sort_order: UndefinedOr[
        Union[ForumSortOrderType, int]
    ] = undefined.UNDEFINED,
    available_tags: UndefinedOr[Sequence[ForumTag]] = undefined.UNDEFINED,
    default_reaction_emoji: Union[
        str, Emoji, UndefinedType, Snowflake
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildForumChannel

Create a forum channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

default_auto_archive_duration

If provided, the auto archive duration Discord's end user client should default to when creating threads in this channel.

This should be either 60, 1440, 4320 or 10080 minutes and, as of writing, ignores the parent channel's set default_auto_archive_duration when passed as hikari.undefined.UNDEFINED.

TYPE: UndefinedOr[Intervalish]

default_thread_rate_limit_per_user

If provided, the ratelimit that should be set in threads created from the forum.

TYPE: UndefinedOr[Intervalish]

default_forum_layout

If provided, the default forum layout to show in the client.

TYPE: UndefinedOr[Union[ForumLayoutType, int]]

default_sort_order

If provided, the default sort order to show in the client.

TYPE: UndefinedOr[Union[ForumSortOrderType, int]]

available_tags

If provided, the available tags to select from when creating a thread.

TYPE: UndefinedOr[Sequence[ForumTag]]

default_reaction_emoji

If provided, the new default reaction emoji for threads created in a forum channel.

TYPE: Union[str, Emoji, UndefinedType, Snowflake]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildForumChannel

The created forum channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_news_channel async #

create_news_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildNewsChannel

Create a news channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildNewsChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_stage_channel async #

create_stage_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildStageChannel

Create a stage channel in the guild.

PARAMETER DESCRIPTION
name

The channel's name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildStageChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_sticker async #

create_sticker(
    name: str,
    tag: str,
    image: Resourceish,
    *,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Create a sticker in a guild.

Note

Lottie support is only available for verified and partnered servers.

PARAMETER DESCRIPTION
name

The name for the sticker.

TYPE: str

tag

The tag for the sticker.

TYPE: str

image

The 320x320 image for the sticker. Maximum upload size is 500kb. This can be a still PNG, an animated PNG, a Lottie, or a GIF.

TYPE: Resourceish

PARAMETER DESCRIPTION
description

If provided, the description of the sticker.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The created sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value or if there are no more spaces for the sticker in the guild.

ForbiddenError
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_text_channel async #

create_text_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildTextChannel

Create a text channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildTextChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_voice_channel async #

create_voice_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    video_quality_mode: UndefinedOr[
        Union[VideoQualityMode, int]
    ] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildVoiceChannel

Create a voice channel in a guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

video_quality_mode

If provided, the new video quality mode for the channel.

TYPE: UndefinedOr[Union[VideoQualityMode, int]]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildVoiceChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the gui ld is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_channel async #

delete_channel(channel: SnowflakeishOr[GuildChannel]) -> GuildChannel

Delete a channel in the guild.

Note

This method can also be used for deleting guild categories as well.

Note

For Public servers, the set 'Rules' or 'Guidelines' channels and the 'Public Server Updates' channel cannot be deleted.

PARAMETER DESCRIPTION
channel

The channel or category to delete. This may be the object or the ID of an existing channel.

TYPE: SnowflakeishOr[GuildChannel]

RETURNS DESCRIPTION
GuildChannel

Object of the channel or category that was deleted.

RAISES DESCRIPTION
hikari.errors.UnauthorizedError, or close a DM.

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_sticker async #

delete_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Delete a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to delete. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit async #

edit(
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    verification_level: UndefinedOr[
        GuildVerificationLevel
    ] = undefined.UNDEFINED,
    default_message_notifications: UndefinedOr[
        GuildMessageNotificationsLevel
    ] = undefined.UNDEFINED,
    explicit_content_filter_level: UndefinedOr[
        GuildExplicitContentFilterLevel
    ] = undefined.UNDEFINED,
    afk_channel: UndefinedOr[
        SnowflakeishOr[GuildVoiceChannel]
    ] = undefined.UNDEFINED,
    afk_timeout: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    icon: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    owner: UndefinedOr[SnowflakeishOr[PartialUser]] = undefined.UNDEFINED,
    splash: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    banner: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    system_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    rules_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    public_updates_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    preferred_locale: UndefinedOr[Union[str, Locale]] = undefined.UNDEFINED,
    features: UndefinedOr[Sequence[GuildFeature]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> RESTGuild

Edit the guild.

PARAMETER DESCRIPTION
name

If provided, the new name for the guild.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

verification_level

If provided, the new verification level.

TYPE: UndefinedOr[GuildVerificationLevel] DEFAULT: UNDEFINED

default_message_notifications

If provided, the new default message notifications level.

TYPE: UndefinedOr[GuildMessageNotificationsLevel] DEFAULT: UNDEFINED

explicit_content_filter_level

If provided, the new explicit content filter level.

TYPE: UndefinedOr[GuildExplicitContentFilterLevel] DEFAULT: UNDEFINED

afk_channel

If provided, the new afk channel. Requires afk_timeout to be set to work.

TYPE: UndefinedOr[SnowflakeishOr[GuildVoiceChannel]] DEFAULT: UNDEFINED

afk_timeout

If provided, the new afk timeout.

TYPE: UndefinedOr[Intervalish] DEFAULT: UNDEFINED

icon

If provided, the new guild icon. Must be a 1024x1024 image or can be an animated gif when the guild has the hikari.guilds.GuildFeature.ANIMATED_ICON feature.

TYPE: UndefinedOr[Resourceish] DEFAULT: UNDEFINED

owner

If provided, the new guild owner.

Warning

You need to be the owner of the server to use this.

TYPE: hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishOr[hikari.users.PartialUser]]] DEFAULT: UNDEFINED

splash

If provided, the new guild splash. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.INVITE_SPLASH feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

banner

If provided, the new guild banner. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.BANNER feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

system_channel

If provided, the new system channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

rules_channel

If provided, the new rules channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

public_updates_channel

If provided, the new public updates channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

preferred_locale

If provided, the new preferred locale.

TYPE: UndefinedNoneOr[str] DEFAULT: UNDEFINED

features

If provided, the guild features to be enabled. Features not provided will be disabled.

TYPE: UndefinedOr[Sequence[GuildFeatures]] DEFAULT: UNDEFINED

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
RESTGuild

The edited guild.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value. Or you are missing the

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_GUILD permission or if you tried to pass ownership without being the server owner.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit_sticker async #

edit_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    tag: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Edit a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to edit. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
name

If provided, the new name for the sticker.

TYPE: UndefinedOr[str]

description

If provided, the new description for the sticker.

TYPE: UndefinedOr[str]

tag

If provided, the new sticker tag.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The edited sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emoji async #

Fetch an emoji from the guild.

PARAMETER DESCRIPTION
emoji

The emoji to fetch. This can be a hikari.emojis.CustomEmoji or the ID of an existing emoji.

TYPE: SnowflakeishOr[CustomEmoji]

RETURNS DESCRIPTION
KnownCustomEmoji

The requested emoji.

RAISES DESCRIPTION
NotFoundError

If the guild or the emoji are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emojis async #

fetch_emojis() -> Sequence[KnownCustomEmoji]

Fetch the emojis of the guild.

RETURNS DESCRIPTION
Sequence[KnownCustomEmoji]

The requested emojis.

RAISES DESCRIPTION
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_roles async #

fetch_roles() -> Sequence[Role]

Fetch the roles of the guild.

RETURNS DESCRIPTION
Sequence[Role]

The requested roles.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_self async #

fetch_self() -> RESTGuild

Fetch the guild.

RETURNS DESCRIPTION
RESTGuild

The requested guild.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the guild.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_sticker async #

fetch_sticker(sticker: SnowflakeishOr[PartialSticker]) -> GuildSticker

Fetch a sticker from the guild.

PARAMETER DESCRIPTION
sticker

The sticker to fetch. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

RETURNS DESCRIPTION
GuildSticker

The requested sticker.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_stickers async #

fetch_stickers() -> Sequence[GuildSticker]

Fetch the stickers of the guild.

RETURNS DESCRIPTION
Sequence[GuildSticker]

The requested stickers.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

kick async #

kick(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Kick the given user from this guild.

PARAMETER DESCRIPTION
user

The user to kick from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.KICK_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

make_icon_url #

make_icon_url(*, ext: Optional[str] = None, size: int = 4096) -> Optional[URL]

Generate the guild's icon URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the icon is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the resource, or None if no icon is set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

unban async #

unban(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Unban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to unban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

PartialIntegration #

Bases: Unique

A partial representation of an integration, found in audit logs.

account class-attribute instance-attribute #

account: IntegrationAccount = field(eq=False, hash=False, repr=False)

The account connected to this integration.

created_at property #

created_at: datetime

When the object was created.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of this integration.

type class-attribute instance-attribute #

type: Union[IntegrationType, str] = field(eq=False, hash=False, repr=True)

The type of this integration.

PartialRole #

Bases: Unique

Represents a partial guild bound role object.

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False, eq=False, hash=False, metadata={SKIP_DEEP_COPY: True}
)

Client application that models may use for procedures.

created_at property #

created_at: datetime

When the object was created.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

mention property #

mention: str

Return a raw mention string for the role.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The role's name.

RESTGuild #

Bases: Guild

Guild specialization that is sent via the REST API only.

afk_channel_id class-attribute instance-attribute #

afk_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID for the channel that AFK voice users get sent to.

If None, then no AFK channel is set up for this guild.

afk_timeout class-attribute instance-attribute #

afk_timeout: timedelta = field(eq=False, hash=False, repr=False)

Timeout for activity before a member is classed as AFK.

How long a voice user has to be AFK for before they are classed as being AFK and are moved to the AFK channel (hikari.guilds.Guild.afk_channel_id).

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False, eq=False, hash=False, metadata={SKIP_DEEP_COPY: True}
)

Client application that models may use for procedures.

application_id class-attribute instance-attribute #

application_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the application that created this guild.

This will always be None for guilds that weren't created by a bot.

approximate_active_member_count class-attribute instance-attribute #

approximate_active_member_count: Optional[int] = field(
    eq=False, hash=False, repr=False
)

The approximate number of members in the guild that are not offline.

This will be None when creating a guild.

approximate_member_count class-attribute instance-attribute #

approximate_member_count: Optional[int] = field(
    eq=False, hash=False, repr=False
)

The approximate number of members in the guild.

This will be None when creating a guild.

banner_hash class-attribute instance-attribute #

banner_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash for the guild's banner.

This is only present if the guild has hikari.guilds.GuildFeature.BANNER in hikari.guilds.Guild.features for this guild. For all other purposes, it is None.

banner_url property #

banner_url: Optional[URL]

Banner URL for the guild, if set.

created_at property #

created_at: datetime

When the object was created.

default_message_notifications class-attribute instance-attribute #

default_message_notifications: Union[GuildMessageNotificationsLevel, int] = (
    field(eq=False, hash=False, repr=False)
)

The default setting for message notifications in this guild.

description class-attribute instance-attribute #

description: Optional[str] = field(eq=False, hash=False, repr=False)

The guild's description.

This is only present if certain hikari.guilds.GuildFeature's are set in hikari.guilds.Guild.features for this guild. Otherwise, this will always be None.

discovery_splash_hash class-attribute instance-attribute #

discovery_splash_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash of the discovery splash for the guild, if there is one.

discovery_splash_url property #

discovery_splash_url: Optional[URL]

Discovery splash URL for the guild, if set.

emojis class-attribute instance-attribute #

emojis: Mapping[Snowflake, KnownCustomEmoji] = field(
    eq=False, hash=False, repr=False
)

A mapping of emoji IDs to the objects of the emojis this guild provides.

explicit_content_filter class-attribute instance-attribute #

explicit_content_filter: Union[GuildExplicitContentFilterLevel, int] = field(
    eq=False, hash=False, repr=False
)

The setting for the explicit content filter in this guild.

features class-attribute instance-attribute #

features: Sequence[Union[str, GuildFeature]] = field(
    eq=False, hash=False, repr=False
)

A list of the features in this guild.

icon_hash class-attribute instance-attribute #

icon_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash for the guild icon, if there is one.

icon_url property #

icon_url: Optional[URL]

Icon URL for the guild, if set; otherwise None.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

is_widget_enabled class-attribute instance-attribute #

is_widget_enabled: Optional[bool] = field(eq=False, hash=False, repr=False)

Describes whether the guild widget is enabled or not.

If this information is not present, this will be None.

max_members class-attribute instance-attribute #

max_members: int = field(eq=False, hash=False, repr=False)

The maximum number of members allowed in this guild.

max_presences class-attribute instance-attribute #

max_presences: Optional[int] = field(eq=False, hash=False, repr=False)

The maximum number of presences for the guild.

If None, then there is no limit.

max_video_channel_users class-attribute instance-attribute #

max_video_channel_users: Optional[int] = field(eq=False, hash=False, repr=False)

The maximum number of users allowed in a video channel together.

This information may not be present, in which case, it will be None.

mfa_level class-attribute instance-attribute #

mfa_level: Union[GuildMFALevel, int] = field(eq=False, hash=False, repr=False)

The required MFA level for users wishing to participate in this guild.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The name of the guild.

nsfw_level class-attribute instance-attribute #

nsfw_level: GuildNSFWLevel = field(eq=False, hash=False, repr=False)

The NSFW level of the guild.

owner_id class-attribute instance-attribute #

owner_id: Snowflake = field(eq=False, hash=False, repr=True)

The ID of the owner of this guild.

preferred_locale class-attribute instance-attribute #

preferred_locale: Union[str, Locale] = field(eq=False, hash=False, repr=False)

The preferred locale to use for this guild.

This can only be change if hikari.guilds.GuildFeature.COMMUNITY is in hikari.guilds.Guild.features for this guild and will otherwise default to en-US.

premium_subscription_count class-attribute instance-attribute #

premium_subscription_count: Optional[int] = field(
    eq=False, hash=False, repr=False
)

The number of nitro boosts that the server currently has.

This information may not be present, in which case, it will be None.

premium_tier class-attribute instance-attribute #

premium_tier: Union[GuildPremiumTier, int] = field(
    eq=False, hash=False, repr=False
)

The premium tier for this guild.

public_updates_channel_id class-attribute instance-attribute #

public_updates_channel_id: Optional[Snowflake] = field(
    eq=False, hash=False, repr=False
)

The channel ID of the channel where admins and moderators receive notices from Discord.

This is only present if hikari.guilds.GuildFeature.COMMUNITY is in hikari.guilds.Guild.features for this guild. For all other purposes, it should be considered to be None.

roles class-attribute instance-attribute #

roles: Mapping[Snowflake, Role] = field(eq=False, hash=False, repr=False)

The roles in this guild, represented as a mapping of role ID to role object.

rules_channel_id class-attribute instance-attribute #

rules_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the channel where rules and guidelines will be displayed.

If the hikari.guilds.GuildFeature.COMMUNITY feature is not defined, then this is None.

shard_id property #

shard_id: Optional[int]

Return the ID of the shard this guild is served by.

This may return None if the application does not have a gateway connection.

splash_hash class-attribute instance-attribute #

splash_hash: Optional[str] = field(eq=False, hash=False, repr=False)

The hash of the splash for the guild, if there is one.

splash_url property #

splash_url: Optional[URL]

Splash URL for the guild, if set.

stickers class-attribute instance-attribute #

stickers: Mapping[Snowflake, GuildSticker] = field(
    eq=False, hash=False, repr=False
)

A mapping of sticker IDs to the objects of the stickers this guild provides.

system_channel_flags class-attribute instance-attribute #

system_channel_flags: GuildSystemChannelFlag = field(
    eq=False, hash=False, repr=False
)

Return flags for the guild system channel.

These are used to describe which notifications are suppressed.

system_channel_id class-attribute instance-attribute #

system_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The ID of the system channel or None if it is not enabled.

Welcome messages and Nitro boost messages may be sent to this channel.

vanity_url_code class-attribute instance-attribute #

vanity_url_code: Optional[str] = field(eq=False, hash=False, repr=False)

The vanity URL code for the guild's vanity URL.

This is only present if hikari.guilds.GuildFeature.VANITY_URL is in hikari.guilds.Guild.features for this guild. If not, this will always be None.

verification_level class-attribute instance-attribute #

verification_level: Union[GuildVerificationLevel, int] = field(
    eq=False, hash=False, repr=False
)

The verification level needed for a user to participate in this guild.

widget_channel_id class-attribute instance-attribute #

widget_channel_id: Optional[Snowflake] = field(eq=False, hash=False, repr=False)

The channel ID that the widget's generated invite will send the user to.

If this information is unavailable or this is not enabled for the guild then this will be None.

ban async #

ban(
    user: SnowflakeishOr[PartialUser],
    *,
    delete_message_seconds: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Ban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to ban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
delete_message_seconds

If provided, the number of seconds to delete messages for. This can be represented as either an int/float between 0 and 604800 (7 days), or a datetime.timedelta object.

TYPE: UndefinedNoneOr[Intervalish]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_category async #

create_category(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildCategory

Create a category in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildCategory

The created category.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_forum_channel async #

create_forum_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    default_auto_archive_duration: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_thread_rate_limit_per_user: UndefinedOr[
        Intervalish
    ] = undefined.UNDEFINED,
    default_forum_layout: UndefinedOr[
        Union[ForumLayoutType, int]
    ] = undefined.UNDEFINED,
    default_sort_order: UndefinedOr[
        Union[ForumSortOrderType, int]
    ] = undefined.UNDEFINED,
    available_tags: UndefinedOr[Sequence[ForumTag]] = undefined.UNDEFINED,
    default_reaction_emoji: Union[
        str, Emoji, UndefinedType, Snowflake
    ] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildForumChannel

Create a forum channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

default_auto_archive_duration

If provided, the auto archive duration Discord's end user client should default to when creating threads in this channel.

This should be either 60, 1440, 4320 or 10080 minutes and, as of writing, ignores the parent channel's set default_auto_archive_duration when passed as hikari.undefined.UNDEFINED.

TYPE: UndefinedOr[Intervalish]

default_thread_rate_limit_per_user

If provided, the ratelimit that should be set in threads created from the forum.

TYPE: UndefinedOr[Intervalish]

default_forum_layout

If provided, the default forum layout to show in the client.

TYPE: UndefinedOr[Union[ForumLayoutType, int]]

default_sort_order

If provided, the default sort order to show in the client.

TYPE: UndefinedOr[Union[ForumSortOrderType, int]]

available_tags

If provided, the available tags to select from when creating a thread.

TYPE: UndefinedOr[Sequence[ForumTag]]

default_reaction_emoji

If provided, the new default reaction emoji for threads created in a forum channel.

TYPE: Union[str, Emoji, UndefinedType, Snowflake]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildForumChannel

The created forum channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_news_channel async #

create_news_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildNewsChannel

Create a news channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildNewsChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_stage_channel async #

create_stage_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildStageChannel

Create a stage channel in the guild.

PARAMETER DESCRIPTION
name

The channel's name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildStageChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_sticker async #

create_sticker(
    name: str,
    tag: str,
    image: Resourceish,
    *,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Create a sticker in a guild.

Note

Lottie support is only available for verified and partnered servers.

PARAMETER DESCRIPTION
name

The name for the sticker.

TYPE: str

tag

The tag for the sticker.

TYPE: str

image

The 320x320 image for the sticker. Maximum upload size is 500kb. This can be a still PNG, an animated PNG, a Lottie, or a GIF.

TYPE: Resourceish

PARAMETER DESCRIPTION
description

If provided, the description of the sticker.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The created sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value or if there are no more spaces for the sticker in the guild.

ForbiddenError
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_text_channel async #

create_text_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildTextChannel

Create a text channel in the guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[Intervalish]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildTextChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

create_voice_channel async #

create_voice_channel(
    name: str,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    video_quality_mode: UndefinedOr[
        Union[VideoQualityMode, int]
    ] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Sequence[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED,
    category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildVoiceChannel

Create a voice channel in a guild.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

video_quality_mode

If provided, the new video quality mode for the channel.

TYPE: UndefinedOr[Union[VideoQualityMode, int]]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

category

The category to create the channel under. This may be the object or the ID of an existing category.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildVoiceChannel

The created channel.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the gui ld is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_channel async #

delete_channel(channel: SnowflakeishOr[GuildChannel]) -> GuildChannel

Delete a channel in the guild.

Note

This method can also be used for deleting guild categories as well.

Note

For Public servers, the set 'Rules' or 'Guidelines' channels and the 'Public Server Updates' channel cannot be deleted.

PARAMETER DESCRIPTION
channel

The channel or category to delete. This may be the object or the ID of an existing channel.

TYPE: SnowflakeishOr[GuildChannel]

RETURNS DESCRIPTION
GuildChannel

Object of the channel or category that was deleted.

RAISES DESCRIPTION
hikari.errors.UnauthorizedError, or close a DM.

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_CHANNELS permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

delete_sticker async #

delete_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Delete a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to delete. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit async #

edit(
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    verification_level: UndefinedOr[
        GuildVerificationLevel
    ] = undefined.UNDEFINED,
    default_message_notifications: UndefinedOr[
        GuildMessageNotificationsLevel
    ] = undefined.UNDEFINED,
    explicit_content_filter_level: UndefinedOr[
        GuildExplicitContentFilterLevel
    ] = undefined.UNDEFINED,
    afk_channel: UndefinedOr[
        SnowflakeishOr[GuildVoiceChannel]
    ] = undefined.UNDEFINED,
    afk_timeout: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    icon: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    owner: UndefinedOr[SnowflakeishOr[PartialUser]] = undefined.UNDEFINED,
    splash: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    banner: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED,
    system_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    rules_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    public_updates_channel: UndefinedNoneOr[
        SnowflakeishOr[GuildTextChannel]
    ] = undefined.UNDEFINED,
    preferred_locale: UndefinedOr[Union[str, Locale]] = undefined.UNDEFINED,
    features: UndefinedOr[Sequence[GuildFeature]] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> RESTGuild

Edit the guild.

PARAMETER DESCRIPTION
name

If provided, the new name for the guild.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

verification_level

If provided, the new verification level.

TYPE: UndefinedOr[GuildVerificationLevel] DEFAULT: UNDEFINED

default_message_notifications

If provided, the new default message notifications level.

TYPE: UndefinedOr[GuildMessageNotificationsLevel] DEFAULT: UNDEFINED

explicit_content_filter_level

If provided, the new explicit content filter level.

TYPE: UndefinedOr[GuildExplicitContentFilterLevel] DEFAULT: UNDEFINED

afk_channel

If provided, the new afk channel. Requires afk_timeout to be set to work.

TYPE: UndefinedOr[SnowflakeishOr[GuildVoiceChannel]] DEFAULT: UNDEFINED

afk_timeout

If provided, the new afk timeout.

TYPE: UndefinedOr[Intervalish] DEFAULT: UNDEFINED

icon

If provided, the new guild icon. Must be a 1024x1024 image or can be an animated gif when the guild has the hikari.guilds.GuildFeature.ANIMATED_ICON feature.

TYPE: UndefinedOr[Resourceish] DEFAULT: UNDEFINED

owner

If provided, the new guild owner.

Warning

You need to be the owner of the server to use this.

TYPE: hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishOr[hikari.users.PartialUser]]] DEFAULT: UNDEFINED

splash

If provided, the new guild splash. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.INVITE_SPLASH feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

banner

If provided, the new guild banner. Must be a 16:9 image and the guild must have the hikari.guilds.GuildFeature.BANNER feature.

TYPE: UndefinedNoneOr[Resourceish] DEFAULT: UNDEFINED

system_channel

If provided, the new system channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

rules_channel

If provided, the new rules channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

public_updates_channel

If provided, the new public updates channel.

TYPE: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] DEFAULT: UNDEFINED

preferred_locale

If provided, the new preferred locale.

TYPE: UndefinedNoneOr[str] DEFAULT: UNDEFINED

features

If provided, the guild features to be enabled. Features not provided will be disabled.

TYPE: UndefinedOr[Sequence[GuildFeatures]] DEFAULT: UNDEFINED

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
RESTGuild

The edited guild.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value. Or you are missing the

ForbiddenError

If you are missing the hikari.permissions.Permissions.MANAGE_GUILD permission or if you tried to pass ownership without being the server owner.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

edit_sticker async #

edit_sticker(
    sticker: SnowflakeishOr[PartialSticker],
    *,
    name: UndefinedOr[str] = undefined.UNDEFINED,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    tag: UndefinedOr[str] = undefined.UNDEFINED,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> GuildSticker

Edit a sticker in a guild.

PARAMETER DESCRIPTION
sticker

The sticker to edit. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

PARAMETER DESCRIPTION
name

If provided, the new name for the sticker.

TYPE: UndefinedOr[str]

description

If provided, the new description for the sticker.

TYPE: UndefinedOr[str]

tag

If provided, the new sticker tag.

TYPE: UndefinedOr[str]

reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
GuildSticker

The edited sticker.

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError
NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_afk_channel async #

fetch_afk_channel() -> Optional[GuildVoiceChannel]

Fetch the channel that AFK voice users get sent to.

RETURNS DESCRIPTION
Optional[GuildVoiceChannel]

The AFK channel or None if not enabled.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emoji async #

Fetch an emoji from the guild.

PARAMETER DESCRIPTION
emoji

The emoji to fetch. This can be a hikari.emojis.CustomEmoji or the ID of an existing emoji.

TYPE: SnowflakeishOr[CustomEmoji]

RETURNS DESCRIPTION
KnownCustomEmoji

The requested emoji.

RAISES DESCRIPTION
NotFoundError

If the guild or the emoji are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_emojis async #

fetch_emojis() -> Sequence[KnownCustomEmoji]

Fetch the emojis of the guild.

RETURNS DESCRIPTION
Sequence[KnownCustomEmoji]

The requested emojis.

RAISES DESCRIPTION
NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_owner async #

fetch_owner() -> Member

Fetch the owner of the guild.

RETURNS DESCRIPTION
Member

The guild owner.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or the user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_public_updates_channel async #

fetch_public_updates_channel() -> Optional[GuildTextChannel]

Fetch channel ID of the channel where admins and moderators receive notices from Discord.

This is only present if hikari.guilds.GuildFeature.COMMUNITY is in hikari.guilds.Guild.features for this guild. For all other purposes, it should be considered to be None.

RETURNS DESCRIPTION
Optional[GuildTextChannel]

The channel where discord sends relevant updates to moderators and admins.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_roles async #

fetch_roles() -> Sequence[Role]

Fetch the roles of the guild.

RETURNS DESCRIPTION
Sequence[Role]

The requested roles.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_rules_channel async #

fetch_rules_channel() -> Optional[GuildTextChannel]

Fetch the channel where guilds display rules and guidelines.

If the hikari.guilds.GuildFeature.COMMUNITY feature is not defined, then this is None.

RETURNS DESCRIPTION
Optional[GuildTextChannel]

The channel where the rules of the guild are specified or else None.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_self async #

fetch_self() -> RESTGuild

Fetch the guild.

RETURNS DESCRIPTION
RESTGuild

The requested guild.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the guild.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_sticker async #

fetch_sticker(sticker: SnowflakeishOr[PartialSticker]) -> GuildSticker

Fetch a sticker from the guild.

PARAMETER DESCRIPTION
sticker

The sticker to fetch. This can be a sticker object or the ID of an existing sticker.

TYPE: SnowflakeishOr[PartialSticker]

RETURNS DESCRIPTION
GuildSticker

The requested sticker.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild or the sticker are not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_stickers async #

fetch_stickers() -> Sequence[GuildSticker]

Fetch the stickers of the guild.

RETURNS DESCRIPTION
Sequence[GuildSticker]

The requested stickers.

RAISES DESCRIPTION
ForbiddenError

If you are not part of the server.

NotFoundError

If the guild is not found.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_system_channel async #

fetch_system_channel() -> Optional[GuildTextChannel]

Fetch the system channel.

RETURNS DESCRIPTION
Optional[GuildTextChannel]

The system channel for this guild or None if not enabled.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

fetch_widget_channel async #

fetch_widget_channel() -> Optional[GuildChannel]

Fetch the widget channel.

This will be None if not set.

RETURNS DESCRIPTION
Optional[GuildChannel]

The channel the widget is linked to or else None.

RAISES DESCRIPTION
UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are missing the hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

get_channel #

Get a cached channel that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
channel

The object or ID of the guild channel to get from the cache.

TYPE: SnowflakeishOr[PartialChannel]

RETURNS DESCRIPTION
Optional[GuildChannel]

The object of the guild channel found in cache or None.

get_channels #

Get the channels cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, GuildChannel]

A mapping of channel IDs to objects of the channels cached for the guild.

get_emoji #

Get a cached emoji that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
emoji

The object or ID of the emoji to get from the cache.

TYPE: SnowflakeishOr[CustomEmoji]

RETURNS DESCRIPTION
Optional[KnownCustomEmoji]

The object of the custom emoji if found in cache, else None.

get_emojis #

Return the emojis in this guild.

RETURNS DESCRIPTION
Mapping[Snowflake, KnownCustomEmoji]

A mapping of emoji IDs to the objects of emojis in this guild.

get_member #

get_member(user: SnowflakeishOr[PartialUser]) -> Optional[Member]

Get a cached member that belongs to the guild by it's user ID or object.

PARAMETER DESCRIPTION
user

The object or ID of the user to get the cached member for.

TYPE: SnowflakeishOr[PartialUser]

RETURNS DESCRIPTION
Optional[Member]

The cached member object if found, else None.

get_members #

get_members() -> Mapping[Snowflake, Member]

Get the members cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, Member]

A mapping of user IDs to objects of the members cached for the guild.

get_my_member #

get_my_member() -> Optional[Member]

Return the cached member for the bot user in this guild, if known.

RETURNS DESCRIPTION
Optional[Member]

The cached member for this guild, or None if not known.

get_presence #

Get a cached presence that belongs to the guild by it's user ID or object.

PARAMETER DESCRIPTION
user

The object or ID of the user to get the cached presence for.

TYPE: SnowflakeishOr[PartialUser]

RETURNS DESCRIPTION
Optional[MemberPresence]

The cached presence object if found, else None.

get_presences #

get_presences() -> Mapping[Snowflake, MemberPresence]

Get the presences cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, MemberPresence]

A mapping of user IDs to objects of the presences cached for the guild.

get_role #

get_role(role: SnowflakeishOr[PartialRole]) -> Optional[Role]

Get a cached role that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
role

The object or ID of the role to get for this guild from the cache.

TYPE: SnowflakeishOr[PartialRole]

RETURNS DESCRIPTION
Optional[Role]

The object of the role found in cache, else None.

get_roles #

get_roles() -> Mapping[Snowflake, Role]

Return the roles in this guild.

RETURNS DESCRIPTION
Mapping[Snowflake, Role]

A mapping of role IDs to the objects of roles in this guild.

get_sticker #

get_sticker(sticker: SnowflakeishOr[GuildSticker]) -> Optional[GuildSticker]

Get a cached sticker that belongs to the guild by it's ID or object.

PARAMETER DESCRIPTION
sticker

The object or ID of the sticker to get from the cache.

TYPE: SnowflakeishOr[GuildSticker]

RETURNS DESCRIPTION
Optional[GuildSticker]

The object of the sticker if found in cache, else None.

get_stickers #

get_stickers() -> Mapping[Snowflake, GuildSticker]

Return the stickers in this guild.

RETURNS DESCRIPTION
Mapping[Snowflake, GuildSticker]

A mapping of sticker IDs to the objects of sticker in this guild.

get_voice_state #

get_voice_state(user: SnowflakeishOr[PartialUser]) -> Optional[VoiceState]

Get a cached voice state that belongs to the guild by it's user.

PARAMETER DESCRIPTION
user

The object or ID of the user to get the cached voice state for.

TYPE: SnowflakeishOr[PartialUser]

RETURNS DESCRIPTION
Optional[VoiceState]

The cached voice state object if found, else None.

get_voice_states #

get_voice_states() -> Mapping[Snowflake, VoiceState]

Get the voice states cached for the guild.

RETURNS DESCRIPTION
Mapping[Snowflake, VoiceState]

A mapping of user IDs to objects of the voice states cached for the guild.

kick async #

kick(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Kick the given user from this guild.

PARAMETER DESCRIPTION
user

The user to kick from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.KICK_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

make_banner_url #

make_banner_url(
    *, ext: Optional[str] = None, size: int = 4096
) -> Optional[URL]

Generate the guild's banner image URL, if set.

PARAMETER DESCRIPTION
ext

The ext to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the banner is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL of the banner, or None if no banner is set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_discovery_splash_url #

make_discovery_splash_url(
    *, ext: str = "png", size: int = 4096
) -> Optional[URL]

Generate the guild's discovery splash image URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL, defaults to png. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL, defaults to 4096. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The string URL.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_icon_url #

make_icon_url(*, ext: Optional[str] = None, size: int = 4096) -> Optional[URL]

Generate the guild's icon URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg, webp and gif (when animated).

If None, then the correct default extension is determined based on whether the icon is animated or not.

TYPE: Optional[str] DEFAULT: None

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the resource, or None if no icon is set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

make_splash_url #

make_splash_url(*, ext: str = 'png', size: int = 4096) -> Optional[URL]

Generate the guild's splash image URL, if set.

PARAMETER DESCRIPTION
ext

The extension to use for this URL, defaults to png. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL, defaults to 4096. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the splash, or None if not set.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

unban async #

unban(
    user: SnowflakeishOr[PartialUser],
    *,
    reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None

Unban the given user from this guild.

PARAMETER DESCRIPTION
user

The user to unban from the guild.

TYPE: Snowflakeish[PartialUser]

PARAMETER DESCRIPTION
reason

If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.

TYPE: UndefinedOr[str]

RAISES DESCRIPTION
BadRequestError

If any of the fields that are passed have an invalid value.

ForbiddenError

If you are missing the hikari.permissions.Permissions.BAN_MEMBERS permission.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

NotFoundError

If the guild or user are not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

Role #

Bases: PartialRole

Represents a guild bound role object.

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False, eq=False, hash=False, metadata={SKIP_DEEP_COPY: True}
)

Client application that models may use for procedures.

bot_id class-attribute instance-attribute #

bot_id: Optional[Snowflake] = field(eq=False, hash=False, repr=True)

The ID of the bot this role belongs to.

If None, this is not a bot role.

color class-attribute instance-attribute #

color: Color = field(eq=False, hash=False, repr=True)

The colour of this role.

This will be applied to a member's name in chat if it's their top coloured role.

colour property #

colour: Colour

Alias for the color field.

created_at property #

created_at: datetime

When the object was created.

guild_id class-attribute instance-attribute #

guild_id: Snowflake = field(eq=False, hash=False, repr=True)

The ID of the guild this role belongs to.

icon_hash class-attribute instance-attribute #

icon_hash: Optional[str] = field(eq=False, hash=False, repr=False)

Hash of the role's icon if set, else None.

icon_url property #

icon_url: Optional[URL]

Role icon URL, if there is one.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

integration_id class-attribute instance-attribute #

integration_id: Optional[Snowflake] = field(eq=False, hash=False, repr=True)

The ID of the integration this role belongs to.

If None, this is not a integration role.

is_available_for_purchase class-attribute instance-attribute #

is_available_for_purchase: bool = field(eq=False, hash=False, repr=True)

Whether this role is available for purchase.

is_guild_linked_role class-attribute instance-attribute #

is_guild_linked_role: bool = field(eq=False, hash=False, repr=True)

Whether this role is a linked role in the guild.

is_hoisted class-attribute instance-attribute #

is_hoisted: bool = field(eq=False, hash=False, repr=True)

Whether this role is hoisting the members it's attached to in the member list.

Members will be hoisted under their highest role where this is set to True.

is_managed class-attribute instance-attribute #

is_managed: bool = field(eq=False, hash=False, repr=False)

Whether this role is managed by an integration.

is_mentionable class-attribute instance-attribute #

is_mentionable: bool = field(eq=False, hash=False, repr=False)

Whether this role can be mentioned by all regardless of permissions.

is_premium_subscriber_role class-attribute instance-attribute #

is_premium_subscriber_role: bool = field(eq=False, hash=False, repr=True)

Whether this role is the guild's nitro subscriber role.

mention property #

mention: str

Return a raw mention string for the role.

When this role represents @everyone mentions will only work if mentions_everyone is True.

name class-attribute instance-attribute #

name: str = field(eq=False, hash=False, repr=True)

The role's name.

permissions class-attribute instance-attribute #

permissions: Permissions = field(eq=False, hash=False, repr=False)

The guild wide permissions this role gives to the members it's attached to.

This may be overridden by channel overwrites.

position class-attribute instance-attribute #

position: int = field(eq=False, hash=False, repr=True)

The position of this role in the role hierarchy.

This will start at 0 for the lowest role (@everyone) and increase as you go up the hierarchy.

subscription_listing_id class-attribute instance-attribute #

subscription_listing_id: Optional[Snowflake] = field(
    eq=False, hash=False, repr=True
)

The ID of this role's subscription SKU and listing.

If None, this is not a purchasable role.

unicode_emoji class-attribute instance-attribute #

unicode_emoji: Optional[UnicodeEmoji] = field(eq=False, hash=False, repr=False)

Role's icon as an unicode emoji if set, else None.

make_icon_url #

make_icon_url(*, ext: str = 'png', size: int = 4096) -> Optional[URL]

Generate the icon URL for this role, if set.

If no role icon is set, this returns None.

PARAMETER DESCRIPTION
ext

The extension to use for this URL. Supports png, jpeg, jpg and webp.

TYPE: str DEFAULT: 'png'

size

The size to set for the URL. Can be any power of two between 16 and 4096.

TYPE: int DEFAULT: 4096

RETURNS DESCRIPTION
Optional[URL]

The URL to the icon, or None if not present.

RAISES DESCRIPTION
ValueError

If size is not a power of two or not between 16 and 4096.

WelcomeChannel #

Used to represent channels on guild welcome screens.

channel_id class-attribute instance-attribute #

channel_id: Snowflake = field(hash=False, repr=True)

ID of the channel shown in the welcome screen.

description class-attribute instance-attribute #

description: str = field(hash=False, repr=False)

The description shown for this channel.

emoji_id class-attribute instance-attribute #

emoji_id: Optional[Snowflake] = field(
    default=None, kw_only=True, hash=False, repr=True
)

ID of the emoji shown in the welcome screen channel if it's set to a custom emoji.

emoji_name class-attribute instance-attribute #

emoji_name: Union[str, UnicodeEmoji, None] = field(
    default=None, kw_only=True, hash=False, repr=True
)

The emoji shown in the welcome screen channel if set to a unicode emoji.

Warning

While it may also be present for custom emojis, this is neither guaranteed to be provided nor accurate.

WelcomeScreen #

Used to represent guild welcome screens on Discord.

channels class-attribute instance-attribute #

channels: Sequence[WelcomeChannel] = field(hash=False, repr=True)

An array of up to 5 of the channels shown in the welcome screen.

description class-attribute instance-attribute #

description: Optional[str] = field(hash=False, repr=True)

The guild's description shown in the welcome screen.