hikari.templates
#
Application and entities that are used to describe guild templates on Discord.
Template
#
Represents a template used for creating guilds.
app
class-attribute
instance-attribute
#
Client application that models may use for procedures.
code
class-attribute
instance-attribute
#
The template's unique ID.
created_at
class-attribute
instance-attribute
#
When the template was created.
creator
class-attribute
instance-attribute
#
The user who created the template.
description
class-attribute
instance-attribute
#
The template's description.
is_unsynced
class-attribute
instance-attribute
#
Whether this template is missing changes from it's source guild.
name
class-attribute
instance-attribute
#
The template's name.
source_guild
class-attribute
instance-attribute
#
source_guild: TemplateGuild = field(eq=False, hash=False, repr=True)
The partial object of the guild this template is based on.
updated_at
class-attribute
instance-attribute
#
When the template was last synced with the source guild.
usage_count
class-attribute
instance-attribute
#
The number of times the template has been used to create a guild.
create_guild
async
#
create_guild(name: str, *, icon: UndefinedOr[str]) -> RESTGuild
Make a guild from a template.
Note
This endpoint can only be used by bots in less than 10 guilds.
PARAMETER | DESCRIPTION |
---|---|
name |
The new guilds name.
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
icon |
If provided, the guild icon to set. Must be a 1024x1024 image or can be an animated gif when the guild has the ANIMATED_ICON feature.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
RESTGuild
|
Object of the created guild. |
RAISES | DESCRIPTION |
---|---|
BadRequestError
|
If any of the fields that are passed have an invalid value or if you call this as a bot that’s in more than 10 guilds. |
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. |
delete
async
#
Delete a guild template.
RAISES | DESCRIPTION |
---|---|
ForbiddenError
|
If you are not part of the guild. |
NotFoundError
|
If the guild is not found or you are missing the |
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,
description: UndefinedNoneOr[str] = undefined.UNDEFINED
) -> Template
Modify a guild template.
PARAMETER | DESCRIPTION |
---|---|
name |
The name to set for this template.
TYPE:
|
description |
The description to set for the template.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Template
|
The object of the edited template. |
RAISES | DESCRIPTION |
---|---|
ForbiddenError
|
If you are not part of the guild. |
NotFoundError
|
If the guild is not found or you are missing the |
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_self
async
#
fetch_self() -> Template
Fetch an up-to-date view of this template from the API.
RETURNS | DESCRIPTION |
---|---|
Template
|
An up-to-date view of this template. |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError
|
If you are unauthorized to make the request (invalid/missing token). |
NotFoundError
|
If the template is not found. |
RateLimitTooLongError
|
Raised in the event that a rate limit occurs that is
longer than |
InternalServerError
|
If an internal error occurs on Discord while handling the request. |
sync
async
#
sync() -> Template
Sync a guild template.
RETURNS | DESCRIPTION |
---|---|
Template
|
The object of the synced template. |
RAISES | DESCRIPTION |
---|---|
ForbiddenError
|
If you are not part of the guild or are missing the |
NotFoundError
|
If the guild or template 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. |
TemplateGuild
#
Bases: PartialGuild
The partial guild object attached to hikari.templates.Template
.
afk_channel_id
class-attribute
instance-attribute
#
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
#
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
#
Client application that models may use for procedures.
channels
class-attribute
instance-attribute
#
channels: Mapping[Snowflake, GuildChannel] = field(
eq=False, hash=False, repr=False
)
The channels for the guild.
Note
hikari.channels.GuildChannel.id
will be a unique placeholder on all
the channel objects found attached this template guild.
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
#
The guild's description, 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.
icon_hash
class-attribute
instance-attribute
#
The hash for the guild icon, if there is one.
id
class-attribute
instance-attribute
#
The ID of this entity.
name
class-attribute
instance-attribute
#
The name of the guild.
preferred_locale
class-attribute
instance-attribute
#
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
.
roles
class-attribute
instance-attribute
#
roles: Mapping[Snowflake, TemplateRole] = field(
eq=False, hash=False, repr=False
)
The roles in the guild.
Note
hikari.guilds.Role.id
will be a unique placeholder on all the role
objects found attached this template guild.
shard_id
property
#
Return the ID of the shard this guild is served by.
This may return None
if the application does not have a gateway
connection.
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
#
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.
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.
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:
|
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
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
BadRequestError
|
If any of the fields that are passed have an invalid value. |
ForbiddenError
|
If you are missing the |
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 |
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:
|
PARAMETER | DESCRIPTION |
---|---|
position |
If provided, the position of the category.
TYPE:
|
permission_overwrites |
If provided, the permission overwrites for the category.
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
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 |
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 |
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:
|
PARAMETER | DESCRIPTION |
---|---|
position |
If provided, the position of the category.
TYPE:
|
category |
The category to create the channel under. This may be the object or the ID of an existing category.
TYPE:
|
permission_overwrites |
If provided, the permission overwrites for the category.
TYPE:
|
topic |
If provided, the channels topic. Maximum 1024 characters.
TYPE:
|
nsfw |
If provided, whether to mark the channel as NSFW.
TYPE:
|
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:
|
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
TYPE:
|
default_thread_rate_limit_per_user |
If provided, the ratelimit that should be set in threads created from the forum.
TYPE:
|
default_forum_layout |
If provided, the default forum layout to show in the client.
TYPE:
|
default_sort_order |
If provided, the default sort order to show in the client.
TYPE:
|
available_tags |
If provided, the available tags to select from when creating a thread.
TYPE:
|
default_reaction_emoji |
If provided, the new default reaction emoji for threads created in a forum channel.
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
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 |
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 |
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:
|
PARAMETER | DESCRIPTION |
---|---|
position |
If provided, the position of the channel (relative to the category, if any).
TYPE:
|
topic |
If provided, the channels topic. Maximum 1024 characters.
TYPE:
|
nsfw |
If provided, whether to mark the channel as NSFW.
TYPE:
|
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:
|
permission_overwrites |
If provided, the permission overwrites for the channel.
TYPE:
|
category |
The category to create the channel under. This may be the object or the ID of an existing category.
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
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 |
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 |
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:
|
PARAMETER | DESCRIPTION |
---|---|
position |
If provided, the position of the channel (relative to the category, if any).
TYPE:
|
user_limit |
If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.
TYPE:
|
bitrate |
If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.
TYPE:
|
permission_overwrites |
If provided, the permission overwrites for the channel.
TYPE:
|
region |
If provided, the voice region to for this channel. Passing
TYPE:
|
category |
The category to create the channel under. This may be the object or the ID of an existing category.
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
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 |
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 |
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:
|
tag |
The tag for the sticker.
TYPE:
|
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:
|
PARAMETER | DESCRIPTION |
---|---|
description |
If provided, the description of the sticker.
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
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
|
If you are missing |
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 |
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:
|
PARAMETER | DESCRIPTION |
---|---|
position |
If provided, the position of the channel (relative to the category, if any).
TYPE:
|
topic |
If provided, the channels topic. Maximum 1024 characters.
TYPE:
|
nsfw |
If provided, whether to mark the channel as NSFW.
TYPE:
|
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:
|
permission_overwrites |
If provided, the permission overwrites for the channel.
TYPE:
|
category |
The category to create the channel under. This may be the object or the ID of an existing category.
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
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 |
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 |
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:
|
PARAMETER | DESCRIPTION |
---|---|
position |
If provided, the position of the channel (relative to the category, if any).
TYPE:
|
user_limit |
If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.
TYPE:
|
bitrate |
If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.
TYPE:
|
video_quality_mode |
If provided, the new video quality mode for the channel.
TYPE:
|
permission_overwrites |
If provided, the permission overwrites for the channel.
TYPE:
|
region |
If provided, the voice region to for this channel. Passing
TYPE:
|
category |
The category to create the channel under. This may be the object or the ID of an existing category.
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
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 |
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 |
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:
|
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 |
NotFoundError
|
If the channel is not found. |
RateLimitTooLongError
|
Raised in the event that a rate limit occurs that is
longer than |
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:
|
PARAMETER | DESCRIPTION |
---|---|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ForbiddenError
|
If you are missing |
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 |
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:
|
verification_level |
If provided, the new verification level.
TYPE:
|
default_message_notifications |
If provided, the new default message notifications level.
TYPE:
|
explicit_content_filter_level |
If provided, the new explicit content filter level.
TYPE:
|
afk_channel |
If provided, the new afk channel. Requires
TYPE:
|
afk_timeout |
If provided, the new afk timeout.
TYPE:
|
icon |
If provided, the new guild icon. Must be a 1024x1024 image or can be
an animated gif when the guild has the
TYPE:
|
owner |
If provided, the new guild owner. Warning You need to be the owner of the server to use this.
TYPE:
|
splash |
If provided, the new guild splash. Must be a 16:9 image and the
guild must have the
TYPE:
|
banner |
If provided, the new guild banner. Must be a 16:9 image and the
guild must have the
TYPE:
|
system_channel |
If provided, the new system channel.
TYPE:
|
rules_channel |
If provided, the new rules channel.
TYPE:
|
public_updates_channel |
If provided, the new public updates channel.
TYPE:
|
preferred_locale |
If provided, the new preferred locale.
TYPE:
|
features |
If provided, the guild features to be enabled. Features not provided will be disabled.
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
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 |
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 |
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:
|
PARAMETER | DESCRIPTION |
---|---|
name |
If provided, the new name for the sticker.
TYPE:
|
description |
If provided, the new description for the sticker.
TYPE:
|
tag |
If provided, the new sticker tag.
TYPE:
|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
GuildSticker
|
The edited sticker. |
RAISES | DESCRIPTION |
---|---|
BadRequestError
|
If any of the fields that are passed have an invalid value. |
ForbiddenError
|
If you are missing |
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 |
InternalServerError
|
If an internal error occurs on Discord while handling the request. |
fetch_emoji
async
#
fetch_emoji(emoji: SnowflakeishOr[CustomEmoji]) -> KnownCustomEmoji
Fetch an emoji from the guild.
PARAMETER | DESCRIPTION |
---|---|
emoji |
The emoji to fetch. This can be a
TYPE:
|
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 |
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 |
InternalServerError
|
If an internal error occurs on Discord while handling the request. |
fetch_roles
async
#
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 |
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 |
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:
|
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 |
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 |
InternalServerError
|
If an internal error occurs on Discord while handling the request. |
kick
async
#
kick(
user: SnowflakeishOr[PartialUser],
*,
reason: UndefinedOr[str] = undefined.UNDEFINED
) -> None
Kick the given user from this guild.
PARAMETER | DESCRIPTION |
---|---|
user |
The user to kick from the guild.
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
BadRequestError
|
If any of the fields that are passed have an invalid value. |
ForbiddenError
|
If you are missing the |
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 |
InternalServerError
|
If an internal error occurs on Discord while handling the request. |
make_icon_url
#
Generate the guild's icon URL, if set.
PARAMETER | DESCRIPTION |
---|---|
ext |
The extension to use for this URL.
Supports If |
size |
The size to set for the URL.
Can be any power of two between
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[URL]
|
The URL to the resource, or |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If |
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:
|
PARAMETER | DESCRIPTION |
---|---|
reason |
If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
BadRequestError
|
If any of the fields that are passed have an invalid value. |
ForbiddenError
|
If you are missing the |
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 |
InternalServerError
|
If an internal error occurs on Discord while handling the request. |
TemplateRole
#
Bases: PartialRole
The partial role object attached to hikari.templates.Template
.
app
class-attribute
instance-attribute
#
Client application that models may use for procedures.
color
class-attribute
instance-attribute
#
The colour of this role.
This will be applied to a member's name in chat if it's their top coloured role.
id
class-attribute
instance-attribute
#
The ID of this entity.
is_hoisted
class-attribute
instance-attribute
#
Whether this role is hoisting the members it's attached to in the member list.
members will be hoisted under their highest role where this is set to True
.
is_mentionable
class-attribute
instance-attribute
#
Whether this role can be mentioned by all regardless of permissions.
name
class-attribute
instance-attribute
#
The role's name.
permissions
class-attribute
instance-attribute
#
permissions: Permissions = field(eq=False, hash=False, repr=False)
The guild wide permissions this role gives to the members it's attached to.
This may be overridden by channel overwrites.