Webhook Support¶
Pycord offers support for creating, editing, and executing webhooks through the Webhook class.
- clsWebhook.from_url
- clsWebhook.partial
- asyncdelete
- asyncdelete_message
- asyncedit
- asyncedit_message
- asyncfetch
- asyncfetch_message
- defis_authenticated
- defis_partial
- asyncsend
- class discord.Webhook(data, session, proxy=None, proxy_auth=None, token=None, state=None, parent=None)[исходный код]¶
Represents an asynchronous Discord webhook.
Webhooks are a form to send messages to channels in Discord without a bot user or authentication.
There are two main ways to use Webhooks. The first is through the ones received by the library such as
Guild.webhooks()andTextChannel.webhooks(). The ones received by the library will automatically be bound using the library’s internal HTTP session.The second form involves creating a webhook object manually using the
from_url()orpartial()classmethods.For example, creating a webhook from a URL and using aiohttp:
from discord import Webhook import aiohttp async def foo(): async with aiohttp.ClientSession() as session: webhook = Webhook.from_url('url-here', session=session) await webhook.send('Hello World', username='Foo')
For a synchronous counterpart, see
SyncWebhook.- x == y
Checks if two webhooks are equal.
- x != y
Checks if two webhooks are not equal.
- hash(x)
Returns the webhook’s hash.
Изменено в версии 1.4: Webhooks are now comparable and hashable.
- type¶
The type of the webhook.
Добавлено в версии 1.3.
- Type:
- token¶
The authentication token of the webhook. If this is
Nonethen the webhook cannot be used to make requests.- Type:
Optional[
str]
- user¶
The user this webhook was created by. If the webhook was received without authentication then this will be
None.- Type:
Optional[
abc.User]
- source_guild¶
The guild of the channel that this webhook is following. Only given if
typeisWebhookType.channel_follower.Добавлено в версии 2.0.
- Type:
Optional[
PartialWebhookGuild]
- source_channel¶
The channel that this webhook is following. Only given if
typeisWebhookType.channel_follower.Добавлено в версии 2.0.
- Type:
Optional[
PartialWebhookChannel]
- parent¶
The interaction this webhook belongs to. Only set if
typeisWebhookType.application.Добавлено в версии 2.7.
- Type:
Optional[
Interaction]
- Параметры:
data (
Webhook|FollowerWebhook)session (
ClientSession)parent (
Interaction|None)
- classmethod partial(id, token, *, session, proxy=None, proxy_auth=None, bot_token=None)[исходный код]¶
Creates a partial
Webhook.- Параметры:
id (
int) – The ID of the webhook.token (
str) – The authentication token of the webhook.session (
ClientSession) –The session to use to send requests with. Note that the library does not manage the session and will not close it.
Добавлено в версии 2.0.
The bot authentication token for authenticated requests involving the webhook.
Добавлено в версии 2.0.
- Результат:
A partial
Webhook. A partial webhook is just a webhook object with an ID and a token.- Тип результата:
- classmethod from_url(url, *, session, proxy=None, proxy_auth=None, bot_token=None)[исходный код]¶
Creates a partial
Webhookfrom a webhook URL.- Параметры:
url (
str) – The URL of the webhook.session (
ClientSession) –The session to use to send requests with. Note that the library does not manage the session and will not close it.
Добавлено в версии 2.0.
The bot authentication token for authenticated requests involving the webhook.
Добавлено в версии 2.0.
- Результат:
A partial
Webhook. A partial webhook is just a webhook object with an ID and a token.- Тип результата:
- Исключение:
InvalidArgument – The URL is invalid.
- await fetch(*, prefer_auth=True)[исходный код]¶
This function is a coroutine.
Fetches the current webhook.
This could be used to get a full webhook from a partial webhook.
Добавлено в версии 2.0.
Примечание
When fetching with an unauthenticated webhook, i.e.
is_authenticated()returnsFalse, then the returned webhook does not contain any user information.- Параметры:
prefer_auth (
bool) – Whether to use the bot token over the webhook token if available. Defaults toTrue.- Результат:
The fetched webhook.
- Тип результата:
- Исключение:
HTTPException – Could not fetch the webhook
NotFound – Could not find the webhook by this ID
InvalidArgument – This webhook does not have a token associated with it.
- await delete(*, reason=None, prefer_auth=True)[исходный код]¶
This function is a coroutine.
Deletes this Webhook.
- Параметры:
- Исключение:
HTTPException – Deleting the webhook failed.
NotFound – This webhook does not exist.
Forbidden – You do not have permissions to delete this webhook.
InvalidArgument – This webhook does not have a token associated with it.
- await edit(*, reason=None, name=..., avatar=..., channel=None, prefer_auth=True)[исходный код]¶
This function is a coroutine.
Edits this Webhook.
- Параметры:
avatar (
bytes|None) – A bytes-like object representing the webhook’s new default avatar.The webhook’s new channel. This requires an authenticated webhook.
Добавлено в версии 2.0.
The reason for editing this webhook. Shows up on the audit log.
Добавлено в версии 1.4.
prefer_auth (
bool) –Whether to use the bot token over the webhook token if available. Defaults to
True.Добавлено в версии 2.0.
- Исключение:
HTTPException – Editing the webhook failed.
NotFound – This webhook does not exist.
InvalidArgument – This webhook does not have a token associated with it, or it tried editing a channel without authentication.
- Тип результата:
- await send(content=..., *, username=..., avatar_url=..., tts=False, ephemeral=False, file=..., files=..., embed=..., embeds=..., allowed_mentions=..., view=..., poll=..., thread=..., thread_name=None, applied_tags=..., wait=False, delete_after=None, silent=False, suppress_embeds=False)[исходный код]¶
This function is a coroutine.
Sends a message using the webhook.
The content must be a type that can convert to a string through
str(content).To upload a single file, the
fileparameter should be used with a singleFileobject.If the
embedparameter is provided, it must be of typeEmbedand it must be a rich embed type. You cannot mix theembedparameter with theembedsparameter, which must be alistofEmbedobjects to send.- Параметры:
content (
str) – The content of the message to send.wait (
bool) – Whether the server should wait before sending a response. This essentially means that the return type of this function changes fromNoneto aWebhookMessageif set toTrue. If the type of webhook isWebhookType.applicationthen this is always set toTrue.username (
str) – The username to send with this message. If no username is provided then the default username for the webhook is used.avatar_url (
Any) – The avatar URL to send with this message. If no avatar URL is provided then the default avatar for the webhook is used. If this is not a string then it is explicitly cast usingstr.tts (
bool) – Indicates if the message should be sent using text-to-speech.ephemeral (
bool) –Indicates if the message should only be visible to the user. This is only available to
WebhookType.applicationwebhooks. If a view is sent with an ephemeral message, and it has no timeout set then the timeout is set to 15 minutes.Добавлено в версии 2.0.
file (
File) – The file to upload. This cannot be mixed withfilesparameter.files (
list[File]) – A list of files to send with the content. This cannot be mixed with thefileparameter.embed (
Embed) – The rich embed for the content to send. This cannot be mixed withembedsparameter.embeds (
list[Embed]) – A list of embeds to send with the content. Maximum of 10. This cannot be mixed with theembedparameter.allowed_mentions (
AllowedMentions) –Controls the mentions being processed in this message.
Добавлено в версии 1.4.
view (
BaseView) –The view to send with the message. You can only send a view if this webhook is not partial and has state attached. A webhook has state attached if the webhook is managed by the library.
Добавлено в версии 2.0.
thread (
Snowflake) –The thread to send this webhook to.
Добавлено в версии 2.0.
The name of the thread to create. Only works for forum channels.
Добавлено в версии 2.0.
applied_tags (
list[Snowflake]) –A list of tags to apply to the message. Only works for threads.
Добавлено в версии 2.5.
delete_after (
float) – If provided, the number of seconds to wait in the background before deleting the message we just sent.poll (
Poll) –The poll to send.
Добавлено в версии 2.6.
silent (
bool) –Whether to suppress push and desktop notifications for the message.
Добавлено в версии 2.8.
suppress_embeds (
bool) –Whether to suppress embeds for the message.
Добавлено в версии 2.8.
- Результат:
If
waitisTruethen the message that was sent, otherwiseNone.- Тип результата:
- Исключение:
HTTPException – Sending the message failed.
NotFound – This webhook was not found.
Forbidden – The authorization token for the webhook is incorrect.
TypeError – You specified both
embedandembedsorfileandfiles.ValueError – The length of
embedswas invalid.InvalidArgument – Either there was no token associated with this webhook,
ephemeralwas passed with the improper webhook type, there was no state attached with this webhook when giving it a dispatchable view, you specified boththread_nameandthread, orapplied_tagswas passed with neitherthread_namenorthreadspecified.
- property avatar: Asset¶
Returns an
Assetfor the avatar the webhook has.If the webhook does not have a traditional avatar, an asset for the default avatar is returned instead.
- property channel: TextChannel | None¶
The text channel this webhook belongs to.
If this is a partial webhook, then this will always return
None.
- await fetch_message(id, *, thread_id=None)[исходный код]¶
This function is a coroutine.
Retrieves a single
WebhookMessageowned by this webhook.Добавлено в версии 2.0.
- Параметры:
- Результат:
The message asked for.
- Тип результата:
- Исключение:
NotFound – The specified message was not found.
Forbidden – You do not have the permissions required to get a message.
HTTPException – Retrieving the message failed.
InvalidArgument – There was no token associated with this webhook.
- property guild: Guild | None¶
The guild this webhook belongs to.
If this is a partial webhook, then this will always return
None.
- is_authenticated()¶
Whether the webhook is authenticated with a bot token.
Добавлено в версии 2.0.
- Тип результата:
- is_partial()¶
Whether the webhook is a «partial» webhook.
Добавлено в версии 2.0.
- Тип результата:
- await edit_message(message_id, *, content=..., embeds=..., embed=..., file=..., files=..., attachments=..., view=..., allowed_mentions=None, thread=..., suppress=None, suppress_embeds=None)[исходный код]¶
This function is a coroutine.
Edits a message owned by this webhook.
This is a lower level interface to
WebhookMessage.edit()in case you only have an ID.Добавлено в версии 1.6.
Изменено в версии 2.0: The edit is no longer in-place, instead the newly edited message is returned.
- Параметры:
message_id (
int) – The message ID to edit.content (
str|None) – The content to edit the message with orNoneto clear it.embeds (
list[Embed]) – A list of embeds to edit the message with.embed (
Embed|None) – The embed to edit the message with.Nonesuppresses the embeds. This should not be mixed with theembedsparameter.attachments (
list[Attachment]) – A list of attachments to keep in the message. If[]is passed then all attachments are removed.file (
File) –The file to upload. This cannot be mixed with
filesparameter.Добавлено в версии 2.0.
A list of files to send with the content. This cannot be mixed with the
fileparameter.Добавлено в версии 2.0.
allowed_mentions (
AllowedMentions|None) – Controls the mentions being processed in this message. Seeabc.Messageable.send()for more information.The updated view to update this message with. If
Noneis passed then the view is removed. The webhook must have state attached, similar tosend().Добавлено в версии 2.0.
thread (
Snowflake|None) – The thread that contains the message.Whether to suppress embeds for the message.
Устарело, начиная с версии 2.8.
suppress_embeds (
bool) –Whether to suppress embeds for the message.
Добавлено в версии 2.8.
- Результат:
The newly edited webhook message.
- Тип результата:
- Исключение:
HTTPException – Editing the message failed.
Forbidden – Edited a message that is not yours.
TypeError – You specified both
embedandembedsorfileandfilesValueError – The length of
embedswas invalidInvalidArgument – There was no token associated with this webhook or the webhook had no state.
- await delete_message(message_id, *, thread_id=None)[исходный код]¶
This function is a coroutine.
Deletes a message owned by this webhook.
This is a lower level interface to
WebhookMessage.delete()in case you only have an ID.Добавлено в версии 1.6.
- class discord.WebhookMessage(*, state, channel, data)[исходный код]¶
Represents a message sent from your webhook.
This allows you to edit or delete a message sent by your webhook.
This inherits from
discord.Messagewith changes toedit()anddelete()to work.Добавлено в версии 1.6.
- Параметры:
state (
ConnectionState)channel (
TextChannel|VoiceChannel|StageChannel|Thread|DMChannel|PartialMessageable|GroupChannel)data (
Message)
- await edit(content=..., embeds=..., embed=..., file=..., files=..., attachments=..., view=..., allowed_mentions=None, suppress=..., suppress_embeds=...)[исходный код]¶
This function is a coroutine.
Edits the message.
Добавлено в версии 1.6.
Изменено в версии 2.0: The edit is no longer in-place, instead the newly edited message is returned.
- Параметры:
content (
str|None) – The content to edit the message with orNoneto clear it.embeds (
list[Embed]) – A list of embeds to edit the message with.embed (
Embed|None) – The embed to edit the message with.Nonesuppresses the embeds. This should not be mixed with theembedsparameter.file (
File) –The file to upload. This cannot be mixed with
filesparameter.Добавлено в версии 2.0.
A list of files to send with the content. This cannot be mixed with the
fileparameter.Добавлено в версии 2.0.
attachments (
list[Attachment]) –A list of attachments to keep in the message. If
[]is passed then all attachments are removed.Добавлено в версии 2.0.
allowed_mentions (
AllowedMentions|None) – Controls the mentions being processed in this message. Seeabc.Messageable.send()for more information.The updated view to update this message with. If
Noneis passed then the view is removed.Добавлено в версии 2.0.
Whether to suppress embeds for the message.
Устарело, начиная с версии 2.8.
suppress_embeds (
bool|None) –Whether to suppress embeds for the message.
Добавлено в версии 2.8.
- Результат:
The newly edited message.
- Тип результата:
- Исключение:
HTTPException – Editing the message failed.
Forbidden – Edited a message that is not yours.
TypeError – You specified both
embedandembedsorfileandfilesValueError – The length of
embedswas invalidInvalidArgument – There was no token associated with this webhook.
- await delete(*, delay=None)[исходный код]¶
This function is a coroutine.
Deletes the message.
- Параметры:
delay (
float|None) – If provided, the number of seconds to wait before deleting the message. The waiting is done in the background and deletion failures are ignored.- Исключение:
Forbidden – You do not have proper permissions to delete the message.
NotFound – The message was deleted already.
HTTPException – Deleting the message failed.
- Тип результата:
- clsSyncWebhook.from_url
- clsSyncWebhook.partial
- defdelete
- defdelete_message
- defedit
- defedit_message
- deffetch
- deffetch_message
- defis_authenticated
- defis_partial
- defsend
- class discord.SyncWebhook(data, session, token=None, state=None)[исходный код]¶
Represents a synchronous Discord webhook.
For an asynchronous counterpart, see
Webhook.- x == y
Checks if two webhooks are equal.
- x != y
Checks if two webhooks are not equal.
- hash(x)
Returns the webhook’s hash.
Изменено в версии 1.4: Webhooks are now comparable and hashable.
- type¶
The type of the webhook.
Добавлено в версии 1.3.
- Type:
- token¶
The authentication token of the webhook. If this is
Nonethen the webhook cannot be used to make requests.- Type:
Optional[
str]
- user¶
The user this webhook was created by. If the webhook was received without authentication then this will be
None.- Type:
Optional[
abc.User]
- source_guild¶
The guild of the channel that this webhook is following. Only given if
typeisWebhookType.channel_follower.Добавлено в версии 2.0.
- Type:
Optional[
PartialWebhookGuild]
- source_channel¶
The channel that this webhook is following. Only given if
typeisWebhookType.channel_follower.Добавлено в версии 2.0.
- Type:
Optional[
PartialWebhookChannel]
- classmethod partial(id, token, *, session=..., bot_token=None)[исходный код]¶
Creates a partial
Webhook.- Параметры:
id (
int) – The ID of the webhook.token (
str) – The authentication token of the webhook.session (
Session) – The session to use to send requests with. Note that the library does not manage the session and will not close it. If not given, therequestsauto session creation functions are used instead.bot_token (
str|None) – The bot authentication token for authenticated requests involving the webhook.
- Результат:
A partial
Webhook. A partial webhook is just a webhook object with an ID and a token.- Тип результата:
- classmethod from_url(url, *, session=..., bot_token=None)[исходный код]¶
Creates a partial
Webhookfrom a webhook URL.- Параметры:
url (
str) – The URL of the webhook.session (
Session) – The session to use to send requests with. Note that the library does not manage the session and will not close it. If not given, therequestsauto session creation functions are used instead.bot_token (
str|None) – The bot authentication token for authenticated requests involving the webhook.
- Результат:
A partial
Webhook. A partial webhook is just a webhook object with an ID and a token.- Тип результата:
- Исключение:
InvalidArgument – The URL is invalid.
- fetch(*, prefer_auth=True)[исходный код]¶
Fetches the current webhook.
This could be used to get a full webhook from a partial webhook.
Примечание
When fetching with an unauthenticated webhook, i.e.
is_authenticated()returnsFalse, then the returned webhook does not contain any user information.- Параметры:
prefer_auth (
bool) – Whether to use the bot token over the webhook token if available. Defaults toTrue.- Результат:
The fetched webhook.
- Тип результата:
- Исключение:
HTTPException – Could not fetch the webhook
NotFound – Could not find the webhook by this ID
InvalidArgument – This webhook does not have a token associated with it.
- delete(*, reason=None, prefer_auth=True)[исходный код]¶
Deletes this Webhook.
- Параметры:
- Исключение:
HTTPException – Deleting the webhook failed.
NotFound – This webhook does not exist.
Forbidden – You do not have permissions to delete this webhook.
InvalidArgument – This webhook does not have a token associated with it.
- Тип результата:
- edit(*, reason=None, name=..., avatar=..., channel=None, prefer_auth=True)[исходный код]¶
Edits this Webhook.
- Параметры:
avatar (
bytes|None) – A bytes-like object representing the webhook’s new default avatar.channel (
Snowflake|None) – The webhook’s new channel. This requires an authenticated webhook.The reason for editing this webhook. Shows up on the audit log.
Добавлено в версии 1.4.
prefer_auth (
bool) – Whether to use the bot token over the webhook token if available. Defaults toTrue.
- Результат:
The newly edited webhook.
- Тип результата:
- Исключение:
HTTPException – Editing the webhook failed.
NotFound – This webhook does not exist.
InvalidArgument – This webhook does not have a token associated with it, or it tried editing a channel without authentication.
- send(content=..., *, username=..., avatar_url=..., tts=False, file=..., files=..., embed=..., embeds=..., allowed_mentions=..., thread=..., thread_name=None, wait=False, suppress=None, suppress_embeds=None)[исходный код]¶
Sends a message using the webhook.
The content must be a type that can convert to a string through
str(content).To upload a single file, the
fileparameter should be used with a singleFileobject.If the
embedparameter is provided, it must be of typeEmbedand it must be a rich embed type. You cannot mix theembedparameter with theembedsparameter, which must be alistofEmbedobjects to send.- Параметры:
content (
str) – The content of the message to send.wait (
bool) – Whether the server should wait before sending a response. This essentially means that the return type of this function changes fromNoneto aWebhookMessageif set toTrue.username (
str) – The username to send with this message. If no username is provided then the default username for the webhook is used.avatar_url (
Any) – The avatar URL to send with this message. If no avatar URL is provided then the default avatar for the webhook is used. If this is not a string then it is explicitly cast usingstr.tts (
bool) – Indicates if the message should be sent using text-to-speech.file (
File) – The file to upload. This cannot be mixed withfilesparameter.files (
list[File]) – A list of files to send with the content. This cannot be mixed with thefileparameter.embed (
Embed) – The rich embed for the content to send. This cannot be mixed withembedsparameter.embeds (
list[Embed]) – A list of embeds to send with the content. Maximum of 10. This cannot be mixed with theembedparameter.allowed_mentions (
AllowedMentions) –Controls the mentions being processed in this message.
Добавлено в версии 1.4.
thread (
Snowflake) –The thread to send this message to.
Добавлено в версии 2.0.
The name of the thread to create. Only works for forum channels.
Добавлено в версии 2.0.
Whether to suppress embeds for the message.
Устарело, начиная с версии 2.8.
suppress_embeds (
bool) –Whether to suppress embeds for the message.
Добавлено в версии 2.8.
- Результат:
If
waitisTruethen the message that was sent, otherwiseNone.- Тип результата:
- Исключение:
HTTPException – Sending the message failed.
NotFound – This webhook was not found.
Forbidden – The authorization token for the webhook is incorrect.
TypeError – You specified both
embedandembedsorfileandfilesValueError – The length of
embedswas invalidInvalidArgument – There was no token associated with this webhook, or you specified both a thread to send to and a thread to create (the
threadandthread_nameparameters).
- fetch_message(id, *, thread_id=None)[исходный код]¶
Retrieves a single
SyncWebhookMessageowned by this webhook.Добавлено в версии 2.0.
- Параметры:
- Результат:
The message asked for.
- Тип результата:
- Исключение:
NotFound – The specified message was not found.
Forbidden – You do not have the permissions required to get a message.
HTTPException – Retrieving the message failed.
InvalidArgument – There was no token associated with this webhook.
- property avatar: Asset¶
Returns an
Assetfor the avatar the webhook has.If the webhook does not have a traditional avatar, an asset for the default avatar is returned instead.
- property channel: TextChannel | None¶
The text channel this webhook belongs to.
If this is a partial webhook, then this will always return
None.
- edit_message(message_id, *, content=..., embeds=..., embed=..., file=..., files=..., allowed_mentions=None, thread=..., suppress=None, suppress_embeds=None)[исходный код]¶
Edits a message owned by this webhook.
This is a lower level interface to
WebhookMessage.edit()in case you only have an ID.Добавлено в версии 1.6.
- Параметры:
message_id (
int) – The message ID to edit.content (
str|None) – The content to edit the message with orNoneto clear it.embeds (
list[Embed]) – A list of embeds to edit the message with.embed (
Embed|None) – The embed to edit the message with.Nonesuppresses the embeds. This should not be mixed with theembedsparameter.file (
File) – The file to upload. This cannot be mixed withfilesparameter.files (
list[File]) – A list of files to send with the content. This cannot be mixed with thefileparameter.allowed_mentions (
AllowedMentions|None) – Controls the mentions being processed in this message. Seeabc.Messageable.send()for more information.thread (
Snowflake|None) – The thread that contains the message.Whether to suppress embeds for the message.
Устарело, начиная с версии 2.8.
suppress_embeds (
bool) –Whether to suppress embeds for the message.
Добавлено в версии 2.8.
- Исключение:
HTTPException – Editing the message failed.
Forbidden – Edited a message that is not yours.
TypeError – You specified both
embedandembedsorfileandfilesValueError – The length of
embedswas invalidInvalidArgument – There was no token associated with this webhook.
- Тип результата:
- property guild: Guild | None¶
The guild this webhook belongs to.
If this is a partial webhook, then this will always return
None.
- is_authenticated()¶
Whether the webhook is authenticated with a bot token.
Добавлено в версии 2.0.
- Тип результата:
- is_partial()¶
Whether the webhook is a «partial» webhook.
Добавлено в версии 2.0.
- Тип результата:
- delete_message(message_id, *, thread_id=None)[исходный код]¶
Deletes a message owned by this webhook.
This is a lower level interface to
WebhookMessage.delete()in case you only have an ID.Добавлено в версии 1.6.
- class discord.SyncWebhookMessage(*, state, channel, data)[исходный код]¶
Represents a message sent from your webhook.
This allows you to edit or delete a message sent by your webhook.
This inherits from
discord.Messagewith changes toedit()anddelete()to work.Добавлено в версии 2.0.
- Параметры:
state (
ConnectionState)channel (
TextChannel|VoiceChannel|StageChannel|Thread|DMChannel|PartialMessageable|GroupChannel)data (
Message)
- edit(content=..., embeds=..., embed=..., file=..., files=..., allowed_mentions=None, suppress=..., suppress_embeds=...)[исходный код]¶
Edits the message.
- Параметры:
content (
str|None) – The content to edit the message with orNoneto clear it.embeds (
list[Embed]) – A list of embeds to edit the message with.embed (
Embed|None) – The embed to edit the message with.Nonesuppresses the embeds. This should not be mixed with theembedsparameter.file (
File) – The file to upload. This cannot be mixed withfilesparameter.files (
list[File]) – A list of files to send with the content. This cannot be mixed with thefileparameter.allowed_mentions (
AllowedMentions|None) – Controls the mentions being processed in this message. Seeabc.Messageable.send()for more information.Whether to suppress embeds for the message.
Устарело, начиная с версии 2.8.
suppress_embeds (
bool|None) –Whether to suppress embeds for the message.
Добавлено в версии 2.8.
- Результат:
The newly edited message.
- Тип результата:
- Исключение:
HTTPException – Editing the message failed.
Forbidden – Edited a message that is not yours.
TypeError – You specified both
embedandembedsorfileandfilesValueError – The length of
embedswas invalidInvalidArgument – There was no token associated with this webhook.
- delete(*, delay=None)[исходный код]¶
Deletes the message.
- Параметры:
delay (
float|None) – If provided, the number of seconds to wait before deleting the message. This blocks the thread.- Исключение:
Forbidden – You do not have proper permissions to delete the message.
NotFound – The message was deleted already.
HTTPException – Deleting the message failed.
- Тип результата: