hikari.invites
#
Application and entities that are used to describe invites on Discord.
Invite
#
Bases: InviteCode
Represents an invite that's used to add users to a guild or group dm.
app
class-attribute
instance-attribute
#
Client application that models may use for procedures.
approximate_active_member_count
class-attribute
instance-attribute
#
The approximate amount of presences in this invite's guild.
This is only returned by the GET REST Invites endpoint.
approximate_member_count
class-attribute
instance-attribute
#
The approximate amount of members in this invite's guild.
This is only returned by the GET Invites REST endpoint.
channel
class-attribute
instance-attribute
#
channel: Optional[PartialChannel] = field(eq=False, hash=False, repr=False)
The partial object of the channel this invite targets.
Will be None
for invite objects that are attached to gateway events,
in which case you should refer to hikari.invites.Invite.channel_id
.
channel_id
class-attribute
instance-attribute
#
The ID of the channel this invite targets.
code
class-attribute
instance-attribute
#
The code for this invite.
expires_at
class-attribute
instance-attribute
#
guild
class-attribute
instance-attribute
#
guild: Optional[InviteGuild] = field(eq=False, hash=False, repr=False)
The partial object of the guild this invite belongs to.
Will be None
for group DM invites and when attached to a gateway event;
for invites received over the gateway you should refer to hikari.invites.Invite.guild_id
.
guild_id
class-attribute
instance-attribute
#
The ID of the guild this invite belongs to.
Will be None
for group DM invites.
inviter
class-attribute
instance-attribute
#
The object of the user who created this invite.
target_application
class-attribute
instance-attribute
#
target_application: Optional[InviteApplication] = field(
eq=False, hash=False, repr=False
)
The embedded application this invite targets, if applicable.
target_type
class-attribute
instance-attribute
#
target_type: Union[TargetType, int, None] = field(
eq=False, hash=False, repr=False
)
The type of the target of this invite, if applicable.
InviteCode
#
InviteGuild
#
Bases: PartialGuild
Represents the partial data of a guild that is attached to invites.
app
class-attribute
instance-attribute
#
Client application that models may use for procedures.
banner_hash
class-attribute
instance-attribute
#
The hash for the guild's banner.
This is only present if hikari.guilds.GuildFeature.BANNER
is in the
features
for this guild. For all other purposes, it is None
.
description
class-attribute
instance-attribute
#
The guild's description.
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
#
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.
nsfw_level
class-attribute
instance-attribute
#
nsfw_level: GuildNSFWLevel = field(eq=False, hash=False, repr=False)
The NSFW level of the 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.
splash_hash
class-attribute
instance-attribute
#
The hash of the splash for the guild, if there is one.
vanity_url_code
class-attribute
instance-attribute
#
The vanity URL code for the guild's vanity URL.
This is only present if hikari.guilds.GuildFeature.VANITY_URL
is in the
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 required for a user to participate in this guild.
welcome_screen
class-attribute
instance-attribute
#
welcome_screen: Optional[WelcomeScreen] = field(
eq=False, hash=False, repr=False
)
The welcome screen of a community guild shown to new members, 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:
|
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_banner_url
#
Generate the guild's banner image URL, if set.
PARAMETER | DESCRIPTION |
---|---|
ext |
The ext 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 of the banner, or |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If |
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 |
make_splash_url
#
Generate the guild's splash image URL, if set.
PARAMETER | DESCRIPTION |
---|---|
ext |
The extension to use for this URL.
supports
TYPE:
|
size |
The size to set for the URL.
Can be any power of two between
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[URL]
|
The URL to the splash, 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. |
InviteWithMetadata
#
Bases: Invite
Extends the base hikari.invites.Invite
object with metadata.
The metadata is only returned when getting an invite with guild permissions, rather than it's code.
app
class-attribute
instance-attribute
#
Client application that models may use for procedures.
approximate_active_member_count
class-attribute
instance-attribute
#
The approximate amount of presences in this invite's guild.
This is only returned by the GET REST Invites endpoint.
approximate_member_count
class-attribute
instance-attribute
#
The approximate amount of members in this invite's guild.
This is only returned by the GET Invites REST endpoint.
channel
class-attribute
instance-attribute
#
channel: Optional[PartialChannel] = field(eq=False, hash=False, repr=False)
The partial object of the channel this invite targets.
Will be None
for invite objects that are attached to gateway events,
in which case you should refer to hikari.invites.Invite.channel_id
.
channel_id
class-attribute
instance-attribute
#
The ID of the channel this invite targets.
code
class-attribute
instance-attribute
#
The code for this invite.
created_at
class-attribute
instance-attribute
#
When this invite was created.
expires_at
instance-attribute
#
When this invite will expire.
If this invite doesn't have a set expiry then this will be None
.
guild
class-attribute
instance-attribute
#
guild: Optional[InviteGuild] = field(eq=False, hash=False, repr=False)
The partial object of the guild this invite belongs to.
Will be None
for group DM invites and when attached to a gateway event;
for invites received over the gateway you should refer to hikari.invites.Invite.guild_id
.
guild_id
class-attribute
instance-attribute
#
The ID of the guild this invite belongs to.
Will be None
for group DM invites.
inviter
class-attribute
instance-attribute
#
The object of the user who created this invite.
is_temporary
class-attribute
instance-attribute
#
Whether this invite grants temporary membership.
max_age
class-attribute
instance-attribute
#
The timedelta of how long this invite will be valid for.
If set to None
then this is unlimited.
max_uses
class-attribute
instance-attribute
#
The limit for how many times this invite can be used before it expires.
If set to None
then this is unlimited.
target_application
class-attribute
instance-attribute
#
target_application: Optional[InviteApplication] = field(
eq=False, hash=False, repr=False
)
The embedded application this invite targets, if applicable.
target_type
class-attribute
instance-attribute
#
target_type: Union[TargetType, int, None] = field(
eq=False, hash=False, repr=False
)
The type of the target of this invite, if applicable.
target_user
class-attribute
instance-attribute
#
The object of the user who this invite targets, if set.
uses
class-attribute
instance-attribute
#
The amount of times this invite has been used.
TargetType
#
VanityURL
#
Bases: InviteCode
A special case invite object, that represents a guild's vanity url.