hikari.webhooks#
Application and entities that are used to describe webhooks on Discord.
Module Contents#
- class hikari.webhooks.WebhookType[source]#
Bases:
int
,hikari.internal.enums.Enum
Types of webhook.
- class hikari.webhooks.ExecutableWebhook[source]#
Bases:
abc.ABC
An abstract class with logic for executing entities as webhooks.
- abstract property app: hikari.traits.RESTAware[source]#
Client application that models may use for procedures.
- abstract property webhook_id: hikari.snowflakes.Snowflake[source]#
ID used to execute this entity as a webhook.
- abstract property token: Optional[str][source]#
Webhook’s token.
Note
If this is
None
then the methods provided byExecutableWebhook
will always raise aValueError
.
- async execute(content=undefined.UNDEFINED, *, username=undefined.UNDEFINED, avatar_url=undefined.UNDEFINED, tts=undefined.UNDEFINED, attachment=undefined.UNDEFINED, attachments=undefined.UNDEFINED, component=undefined.UNDEFINED, components=undefined.UNDEFINED, embed=undefined.UNDEFINED, embeds=undefined.UNDEFINED, mentions_everyone=undefined.UNDEFINED, user_mentions=undefined.UNDEFINED, role_mentions=undefined.UNDEFINED, flags=undefined.UNDEFINED)[source]#
Execute the webhook to create a message.
Warning
At the time of writing,
username
andavatar_url
are ignored for interaction webhooks.Additionally, flags this can only be set for interaction webhooks and the only settable flag is EPHEMERAL; this field is just ignored for non-interaction webhooks.
- Parameters
- content
hikari.undefined.UndefinedOr
[typing.Any
] If provided, the message contents. If
hikari.undefined.UNDEFINED
, then nothing will be sent in the content. Any other value here will be cast to astr
.If this is a
hikari.embeds.Embed
and noembed
kwarg is provided, then this will instead update the embed. This allows for simpler syntax when sending an embed alone.Likewise, if this is a
hikari.files.Resource
, then the content is instead treated as an attachment if noattachment
and noattachments
kwargs are provided.
- content
- Other Parameters
- username
hikari.undefined.UndefinedOr
[str
] If provided, the username to override the webhook’s username for this request.
- avatar_url
typing.Union
[hikari.undefined.UndefinedType
,hikari.files.URL
,str
] If provided, the url of an image to override the webhook’s avatar with for this request.
- tts
hikari.undefined.UndefinedOr
[bool] If provided, whether the message will be sent as a TTS message.
- attachment
hikari.undefined.UndefinedOr
[hikari.files.Resourceish
] If provided, the message attachment. This can be a resource, or string of a path on your computer or a URL.
- attachments
hikari.undefined.UndefinedOr
[typing.Sequence
[hikari.files.Resourceish
]] If provided, the message attachments. These can be resources, or strings consisting of paths on your computer or URLs.
- component
hikari.undefined.UndefinedOr
[hikari.api.special_endpoints.ComponentBuilder
] If provided, builder object of the component to include in this message.
- components
hikari.undefined.UndefinedOr
[typing.Sequence
[hikari.api.special_endpoints.ComponentBuilder
]] If provided, a sequence of the component builder objects to include in this message.
- embed
hikari.undefined.UndefinedOr
[hikari.embeds.Embed
] If provided, the message embed.
- embeds
hikari.undefined.UndefinedOr
[typing.Sequence
[hikari.embeds.Embed
]] If provided, the message embeds.
- mentions_everyone
hikari.undefined.UndefinedOr
[bool] If provided, whether the message should parse @everyone/@here mentions.
- user_mentions
hikari.undefined.UndefinedOr
[typing.Union
[hikari.snowflakes.SnowflakeishSequence
[hikari.users.PartialUser
], bool]] If provided, and
True
, all mentions will be parsed. If provided, andFalse
, no mentions will be parsed. Alternatively this may be a collection ofhikari.snowflakes.Snowflake
, orhikari.users.PartialUser
derivatives to enforce mentioning specific users.- role_mentions
hikari.undefined.UndefinedOr
[typing.Union
[hikari.snowflakes.SnowflakeishSequence
[hikari.guilds.PartialRole
], bool]] If provided, and
True
, all mentions will be parsed. If provided, andFalse
, no mentions will be parsed. Alternatively this may be a collection ofhikari.snowflakes.Snowflake
, orhikari.guilds.PartialRole
derivatives to enforce mentioning specific roles.- flags
typing.Union
[hikari.undefined.UndefinedType
,int
,hikari.messages.MessageFlag
] The flags to set for this webhook message.
- username
- Returns
hikari.messages.Message
The created message object.
- Raises
hikari.errors.NotFoundError
If the current webhook is not found.
hikari.errors.BadRequestError
This can be raised if the file is too large; if the embed exceeds the defined limits; if the message content is specified only and empty or greater than
2000
characters; if neither content, file or embeds are specified. If any invalid snowflake IDs are passed; a snowflake may be invalid due to it being outside of the range of a 64 bit integer.hikari.errors.UnauthorizedError
If you pass a token that’s invalid for the target webhook.
ValueError
If either
ExecutableWebhook.token
isNone
or more than 100 unique objects/entities are passed forrole_mentions
oruser_mentions
or iftoken
is not available.TypeError
If both
attachment
andattachments
,component
andcomponents
orembed
andembeds
are specified.
- async fetch_message(message)[source]#
Fetch an old message sent by the webhook.
- Parameters
- message
hikari.snowflakes.SnowflakeishOr
[hikari.messages.PartialMessage
] The message to fetch. This may be the object or the ID of an existing channel.
- message
- Returns
hikari.messages.Message
The requested message.
- Raises
ValueError
If
token
is not available.hikari.errors.UnauthorizedError
If you are unauthorized to make the request (invalid/missing token).
hikari.errors.NotFoundError
If the webhook is not found or the webhook’s message wasn’t found.
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is longer than
max_rate_limit
when making a request.hikari.errors.RateLimitedError
Usually, Hikari will handle and retry on hitting rate-limits automatically. This includes most bucket-specific rate-limits and global rate-limits. In some rare edge cases, however, Discord implements other undocumented rules for rate-limiting, such as limits per attribute. These cannot be detected or handled normally by Hikari due to their undocumented nature, and will trigger this exception if they occur.
hikari.errors.InternalServerError
If an internal error occurs on Discord while handling the request.
- async edit_message(message, content=undefined.UNDEFINED, *, attachment=undefined.UNDEFINED, attachments=undefined.UNDEFINED, component=undefined.UNDEFINED, components=undefined.UNDEFINED, embed=undefined.UNDEFINED, embeds=undefined.UNDEFINED, mentions_everyone=undefined.UNDEFINED, user_mentions=undefined.UNDEFINED, role_mentions=undefined.UNDEFINED)[source]#
Edit a message sent by a webhook.
Note
Mentioning everyone, roles, or users in message edits currently will not send a push notification showing a new mention to people on Discord. It will still highlight in their chat as if they were mentioned, however.
Warning
If you specify a text
content
,mentions_everyone
,mentions_reply
,user_mentions
, androle_mentions
will default toFalse
as the message will be re-parsed for mentions. This will also occur if only one of the four are specifiedThis is a limitation of Discord’s design. If in doubt, specify all four of them each time.
- Parameters
- message
hikari.snowflakes.SnowflakeishOr
[hikari.messages.PartialMessage
] The message to delete. This may be the object or the ID of an existing message.
- content
hikari.undefined.UndefinedNoneOr
[typing.Any
] If provided, the message contents. If
hikari.undefined.UNDEFINED
, then nothing will be sent in the content. Any other value here will be cast to astr
.If this is a
hikari.embeds.Embed
and noembed
nor noembeds
kwarg is provided, then this will instead update the embed. This allows for simpler syntax when sending an embed alone.Likewise, if this is a
hikari.files.Resource
, then the content is instead treated as an attachment if noattachment
and noattachments
kwargs are provided.
- message
- Other Parameters
- attachment
hikari.undefined.UndefinedNoneOr
[typing.Union
[hikari.files.Resourceish
,hikari.messages.Attachment
]] If provided, the attachment to set on the message. If
hikari.undefined.UNDEFINED
, the previous attachment, if present, is not changed. If this isNone
, then the attachment is removed, if present. Otherwise, the new attachment that was provided will be attached.- attachments
hikari.undefined.UndefinedNoneOr
[typing.Sequence
[typing.Union
[hikari.files.Resourceish
,hikari.messages.Attachment
]]] If provided, the attachments to set on the message. If
hikari.undefined.UNDEFINED
, the previous attachments, if present, are not changed. If this isNone
, then the attachments is removed, if present. Otherwise, the new attachments that were provided will be attached.- component
hikari.undefined.UndefinedNoneOr
[hikari.api.special_endpoints.ComponentBuilder
] If provided, builder object of the component to set for this message. This component will replace any previously set components and passing
None
will remove all components.- components
hikari.undefined.UndefinedNoneOr
[typing.Sequence
[hikari.api.special_endpoints.ComponentBuilder
]] If provided, a sequence of the component builder objects set for this message. These components will replace any previously set components and passing
None
or an empty sequence will remove all components.- embed
hikari.undefined.UndefinedNoneOr
[hikari.embeds.Embed
] If provided, the embed to set on the message. If
hikari.undefined.UNDEFINED
, the previous embed(s) are not changed. If this isNone
then any present embeds are removed. Otherwise, the new embed that was provided will be used as the replacement.- embeds
hikari.undefined.UndefinedNoneOr
[typing.Sequence
[hikari.embeds.Embed
]] If provided, the embeds to set on the message. If
hikari.undefined.UNDEFINED
, the previous embed(s) are not changed. If this isNone
then any present embeds are removed. Otherwise, the new embeds that were provided will be used as the replacement.- mentions_everyone
hikari.undefined.UndefinedOr
[bool] If provided, sanitation for
@everyone
mentions. Ifhikari.undefined.UNDEFINED
, then the previous setting is not changed. IfTrue
, then@everyone
/@here
mentions in the message content will show up as mentioning everyone that can view the chat.- user_mentions
hikari.undefined.UndefinedOr
[typing.Union
[hikari.snowflakes.SnowflakeishSequence
[hikari.users.PartialUser
], bool]] If provided, and
True
, all user mentions will be detected. If provided, andFalse
, all user mentions will be ignored if appearing in the message body. Alternatively this may be a collection ofhikari.snowflakes.Snowflake
, orhikari.users.PartialUser
derivatives to enforce mentioning specific users.- role_mentions
hikari.undefined.UndefinedOr
[typing.Union
[hikari.snowflakes.SnowflakeishSequence
[hikari.guilds.PartialRole
], bool]] If provided, and
True
, all role mentions will be detected. If provided, andFalse
, all role mentions will be ignored if appearing in the message body. Alternatively this may be a collection ofhikari.snowflakes.Snowflake
, orhikari.guilds.PartialRole
derivatives to enforce mentioning specific roles.
- attachment
- Returns
hikari.messages.Message
The edited message.
- Raises
ValueError
If more than 100 unique objects/entities are passed for
role_mentions
oruser_mentions
ortoken
is not available.TypeError
If both
attachment
andattachments
are specified or if bothembed
andembeds
are specified.hikari.errors.BadRequestError
This may be raised in several discrete situations, such as messages being empty with no attachments or embeds; messages with more than 2000 characters in them, embeds that exceed one of the many embed limits; too many attachments; attachments that are too large; too many components.
hikari.errors.UnauthorizedError
If you are unauthorized to make the request (invalid/missing token).
hikari.errors.NotFoundError
If the webhook or the message are not found.
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is longer than
max_rate_limit
when making a request.hikari.errors.RateLimitedError
Usually, Hikari will handle and retry on hitting rate-limits automatically. This includes most bucket-specific rate-limits and global rate-limits. In some rare edge cases, however, Discord implements other undocumented rules for rate-limiting, such as limits per attribute. These cannot be detected or handled normally by Hikari due to their undocumented nature, and will trigger this exception if they occur.
hikari.errors.InternalServerError
If an internal error occurs on Discord while handling the request.
- async delete_message(message)[source]#
Delete a given message in a given channel.
- Parameters
- message
hikari.snowflakes.SnowflakeishOr
[hikari.messages.PartialMessage
] The message to delete. This may be the object or the ID of an existing message.
- message
- Raises
ValueError
If
token
is not available.hikari.errors.UnauthorizedError
If you are unauthorized to make the request (invalid/missing token).
hikari.errors.NotFoundError
If the webhook or the message are not found.
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is longer than
max_rate_limit
when making a request.hikari.errors.RateLimitedError
Usually, Hikari will handle and retry on hitting rate-limits automatically. This includes most bucket-specific rate-limits and global rate-limits. In some rare edge cases, however, Discord implements other undocumented rules for rate-limiting, such as limits per attribute. These cannot be detected or handled normally by Hikari due to their undocumented nature, and will trigger this exception if they occur.
hikari.errors.InternalServerError
If an internal error occurs on Discord while handling the request.
- class hikari.webhooks.PartialWebhook[source]#
Bases:
hikari.snowflakes.Unique
Base class for all webhook implementations.
- property mention: str[source]#
Return a raw mention string for the given webhook’s user.
Note
This exists purely for consistency. Webhooks do not receive events from the gateway, and without some bot backend to support it, will not be able to detect mentions of their webhook.
Examples
>>> some_webhook.mention '<@123456789123456789>'
- property avatar_url: Optional[hikari.files.URL][source]#
URL for this webhook’s avatar, if set.
May be
None
if no avatar is set. In this case, you should usedefault_avatar_url
instead.
- property default_avatar_url: hikari.files.URL[source]#
Default avatar URL for the user.
- app: hikari.traits.RESTAware[source]#
Client application that models may use for procedures.
- id: hikari.snowflakes.Snowflake[source]#
The ID of this entity.
- type: Union[WebhookType, int][source]#
The type of the webhook.
- application_id: Optional[hikari.snowflakes.Snowflake][source]#
The ID of the application that created this webhook.
- make_avatar_url(ext='png', size=4096)[source]#
Generate the avatar URL for this webhook’s custom avatar if set.
If no avatar is specified, return
None
. In this case, you should usedefault_avatar
instead.- Parameters
- Returns
typing.Optional
[hikari.files.URL
]The URL of the resource.
None
if no avatar is set (in this case, use thedefault_avatar
instead).
- Raises
ValueError
If
size
is not a power of two between 16 and 4096 (inclusive).
- class hikari.webhooks.IncomingWebhook[source]#
Bases:
PartialWebhook
,ExecutableWebhook
Represents an incoming webhook object on Discord.
This is an endpoint that can have messages sent to it using standard HTTP requests, which enables external services that are not bots to send informational messages to specific channels.
- property webhook_id: hikari.snowflakes.Snowflake[source]#
ID used to execute this entity as a webhook.
- channel_id: hikari.snowflakes.Snowflake[source]#
The channel ID this webhook is for.
- guild_id: hikari.snowflakes.Snowflake[source]#
The guild ID of the webhook.
- author: Optional[hikari.users.User][source]#
The user that created the webhook.
Note
This will be
None
when fetched with the webhook’s token rather than bot authorization or when received within audit logs.
- token: Optional[str][source]#
The token for the webhook.
Note
This is only available for incoming webhooks that are created in the channel settings.
- async delete(*, use_token=undefined.UNDEFINED)[source]#
Delete this webhook.
- Other Parameters
- use_token
hikari.undefined.UndefinedOr
[bool] If set to
True
then the webhook’s token will be used for this request; if set toFalse
then bot authorization will be used; if not specified then the webhook’s token will be used for the request if it’s set else bot authorization.
- use_token
- Raises
hikari.errors.NotFoundError
If this webhook is not found.
hikari.errors.ForbiddenError
If you either lack the
MANAGE_WEBHOOKS
permission or are not a member of the guild this webhook belongs to.ValueError
If
use_token
is passed asTrue
whenIncomingWebhook.token
isNone
.
- async edit(*, name=undefined.UNDEFINED, avatar=undefined.UNDEFINED, channel=undefined.UNDEFINED, reason=undefined.UNDEFINED, use_token=undefined.UNDEFINED)[source]#
Edit this webhook.
- Other Parameters
- name
hikari.undefined.UndefinedOr
[str
] If provided, the new name string.
- avatar
hikari.undefined.UndefinedOr
[hikari.files.Resourceish
] If provided, the new avatar image. If
None
, then it is removed. If not specified, nothing is changed.- channel
hikari.undefined.UndefinedOr
[hikari.snowflakes.SnowflakeishOr
[hikari.channels.WebhookChannelT
]] If provided, the object or ID of the new channel the given webhook should be moved to.
- reason
hikari.undefined.UndefinedOr
[str
] If provided, the audit log reason explaining why the operation was performed. This field will be used when using the webhook’s token rather than bot authorization.
- use_token
hikari.undefined.UndefinedOr
[bool] If set to
True
then the webhook’s token will be used for this request; if set toFalse
then bot authorization will be used; if not specified then the webhook’s token will be used for the request if it’s set else bot authorization.
- name
- Returns
IncomingWebhook
The updated webhook object.
- Raises
ValueError
If
use_token
is passed asTrue
whenIncomingWebhook.token
isNone
.hikari.errors.BadRequestError
If any invalid snowflake IDs are passed; a snowflake may be invalid due to it being outside of the range of a 64 bit integer.
hikari.errors.NotFoundError
If either the webhook or the channel are not found.
hikari.errors.ForbiddenError
If you either lack the
MANAGE_WEBHOOKS
permission or are not a member of the guild this webhook belongs to.hikari.errors.UnauthorizedError
If you pass a token that’s invalid for the target webhook.
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is longer than
max_rate_limit
when making a request.hikari.errors.RateLimitedError
Usually, Hikari will handle and retry on hitting rate-limits automatically. This includes most bucket-specific rate-limits and global rate-limits. In some rare edge cases, however, Discord implements other undocumented rules for rate-limiting, such as limits per attribute. These cannot be detected or handled normally by Hikari due to their undocumented nature, and will trigger this exception if they occur.
hikari.errors.InternalServerError
If an internal error occurs on Discord while handling the request.
- async fetch_channel()[source]#
Fetch the channel this webhook is for.
- Returns
hikari.channels.WebhookChannelT
The object of the channel this webhook targets.
- Raises
hikari.errors.ForbiddenError
If you don’t have access to the channel this webhook belongs to.
hikari.errors.NotFoundError
If the channel this message was created in does not exist.
hikari.errors.UnauthorizedError
If you are unauthorized to make the request (invalid/missing token).
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is longer than
max_rate_limit
when making a request.hikari.errors.RateLimitedError
Usually, Hikari will handle and retry on hitting rate-limits automatically. This includes most bucket-specific rate-limits and global rate-limits. In some rare edge cases, however, Discord implements other undocumented rules for rate-limiting, such as limits per attribute. These cannot be detected or handled normally by Hikari due to their undocumented nature, and will trigger this exception if they occur.
hikari.errors.InternalServerError
If an internal error occurs on Discord while handling the request.
- async fetch_self(*, use_token=undefined.UNDEFINED)[source]#
Fetch this webhook.
- Other Parameters
- use_token
hikari.undefined.UndefinedOr
[bool] If set to
True
then the webhook’s token will be used for this request; if set toFalse
then bot authorization will be used; if not specified then the webhook’s token will be used for the request if it’s set else bot authorization.
- use_token
- Returns
IncomingWebhook
The requested webhook object.
- Raises
ValueError
hikari.errors.ForbiddenError
If you’re not in the guild that owns this webhook or lack the
MANAGE_WEBHOOKS
permission.hikari.errors.NotFoundError
If the webhook is not found.
hikari.errors.UnauthorizedError
If you pass a token that’s invalid for the target webhook.
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is longer than
max_rate_limit
when making a request.hikari.errors.RateLimitedError
Usually, Hikari will handle and retry on hitting rate-limits automatically. This includes most bucket-specific rate-limits and global rate-limits. In some rare edge cases, however, Discord implements other undocumented rules for rate-limiting, such as limits per attribute. These cannot be detected or handled normally by Hikari due to their undocumented nature, and will trigger this exception if they occur.
hikari.errors.InternalServerError
If an internal error occurs on Discord while handling the request.
- class hikari.webhooks.ChannelFollowerWebhook[source]#
Bases:
PartialWebhook
Represents a channel follower webhook object on Discord.
- channel_id: hikari.snowflakes.Snowflake[source]#
The channel ID this webhook is for.
- guild_id: hikari.snowflakes.Snowflake[source]#
The guild ID of the webhook.
- author: Optional[hikari.users.User][source]#
The user that created the webhook.
Note
This will be
None
when received within an audit log.
- source_channel: hikari.channels.PartialChannel[source]#
The partial object of the channel this webhook is following.
- source_guild: hikari.guilds.PartialGuild[source]#
The partial object of the guild this webhook is following.
- async delete()[source]#
Delete this webhook.
- Raises
hikari.errors.NotFoundError
If this webhook is not found.
hikari.errors.ForbiddenError
If you either lack the
MANAGE_WEBHOOKS
permission or are not a member of the guild this webhook belongs to.
- async edit(*, name=undefined.UNDEFINED, avatar=undefined.UNDEFINED, channel=undefined.UNDEFINED, reason=undefined.UNDEFINED)[source]#
Edit this webhook.
- Other Parameters
- name
hikari.undefined.UndefinedOr
[str
] If provided, the new name string.
- avatar
hikari.undefined.UndefinedOr
[hikari.files.Resourceish
] If provided, the new avatar image. If
None
, then it is removed. If not specified, nothing is changed.- channel
hikari.undefined.UndefinedOr
[hikari.snowflakes.SnowflakeishOr
[hikari.channels.WebhookChannelT
]] If provided, the object or ID of the new channel the given webhook should be moved to.
- reason
hikari.undefined.UndefinedOr
[str
] If provided, the audit log reason explaining why the operation was performed. This field will be used when using the webhook’s token rather than bot authorization.
- name
- Returns
hikari.webhooks.ChannelFollowerWebhook
The updated webhook object.
- Raises
hikari.errors.BadRequestError
If any invalid snowflake IDs are passed; a snowflake may be invalid due to it being outside of the range of a 64 bit integer.
hikari.errors.NotFoundError
If either the webhook or the channel are not found.
hikari.errors.ForbiddenError
If you either lack the
MANAGE_WEBHOOKS
permission or are not a member of the guild this webhook belongs to.hikari.errors.UnauthorizedError
If you pass a token that’s invalid for the target webhook.
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is longer than
max_rate_limit
when making a request.hikari.errors.RateLimitedError
Usually, Hikari will handle and retry on hitting rate-limits automatically. This includes most bucket-specific rate-limits and global rate-limits. In some rare edge cases, however, Discord implements other undocumented rules for rate-limiting, such as limits per attribute. These cannot be detected or handled normally by Hikari due to their undocumented nature, and will trigger this exception if they occur.
hikari.errors.InternalServerError
If an internal error occurs on Discord while handling the request.
- async fetch_channel()[source]#
Fetch the channel this webhook is for.
- Returns
hikari.channels.WebhookChannelT
The object of the channel this webhook targets.
- Raises
hikari.errors.ForbiddenError
If you don’t have access to the channel this webhook belongs to.
hikari.errors.NotFoundError
If the channel this message was created in does not exist.
hikari.errors.UnauthorizedError
If you are unauthorized to make the request (invalid/missing token).
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is longer than
max_rate_limit
when making a request.hikari.errors.RateLimitedError
Usually, Hikari will handle and retry on hitting rate-limits automatically. This includes most bucket-specific rate-limits and global rate-limits. In some rare edge cases, however, Discord implements other undocumented rules for rate-limiting, such as limits per attribute. These cannot be detected or handled normally by Hikari due to their undocumented nature, and will trigger this exception if they occur.
hikari.errors.InternalServerError
If an internal error occurs on Discord while handling the request.
- async fetch_self()[source]#
Fetch this webhook.
- Returns
hikari.webhooks.ChannelFollowerWebhook
The requested webhook object.
- Raises
hikari.errors.ForbiddenError
If you’re not in the guild that owns this webhook or lack the
MANAGE_WEBHOOKS
permission.hikari.errors.NotFoundError
If the webhook is not found.
hikari.errors.UnauthorizedError
If you pass a token that’s invalid for the target webhook.
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is longer than
max_rate_limit
when making a request.hikari.errors.RateLimitedError
Usually, Hikari will handle and retry on hitting rate-limits automatically. This includes most bucket-specific rate-limits and global rate-limits. In some rare edge cases, however, Discord implements other undocumented rules for rate-limiting, such as limits per attribute. These cannot be detected or handled normally by Hikari due to their undocumented nature, and will trigger this exception if they occur.
hikari.errors.InternalServerError
If an internal error occurs on Discord while handling the request.
- class hikari.webhooks.ApplicationWebhook[source]#
Bases:
PartialWebhook
Represents an application webhook object on Discord.
This is from the interactions flow.