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 longe