aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-04-15 07:20:28 -0400
committerRapptz <[email protected]>2021-04-15 08:04:32 -0400
commita6f7213c89e9d592c69ea3c631b0cb2bdab19577 (patch)
tree2fc416e2a3f5404d797ba4bf06cee405523ce23c /docs
parent[commands] Fix missing `re` import in Context (diff)
downloaddiscord.py-a6f7213c89e9d592c69ea3c631b0cb2bdab19577.tar.xz
discord.py-a6f7213c89e9d592c69ea3c631b0cb2bdab19577.zip
Rewrite webhooks to play better with typings and rate limits
This unfortunately required splitting the types into two. This led to a lot of unfortunate code duplication that I didn't really enjoy writing. The new design allows users to pass an authentication token to make webhook requests without the webhook token and allows to finally edit the webhook channel. The new design also uses a contextvar to store rate limiting information so multiple instances or recreating instances no longer clears the ratelimiting state since it's now essentially a "global" object. Closes #6525, closes #6662, closes #2509, closes #1761
Diffstat (limited to 'docs')
-rw-r--r--docs/api.rst21
1 files changed, 11 insertions, 10 deletions
diff --git a/docs/api.rst b/docs/api.rst
index 28615d3d..d20a62c2 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -2495,7 +2495,7 @@ Webhook
.. attributetable:: Webhook
-.. autoclass:: Webhook
+.. autoclass:: Webhook()
:members:
WebhookMessage
@@ -2503,22 +2503,23 @@ WebhookMessage
.. attributetable:: WebhookMessage
-.. autoclass:: WebhookMessage
+.. autoclass:: WebhookMessage()
:members:
-Adapters
-~~~~~~~~~
+SyncWebhook
+~~~~~~~~~~~~
-Adapters allow you to change how the request should be handled. They all build on a single
-interface, :meth:`WebhookAdapter.request`.
+.. attributetable:: SyncWebhook
-.. autoclass:: WebhookAdapter
+.. autoclass:: SyncWebhook()
:members:
-.. autoclass:: AsyncWebhookAdapter
- :members:
+SyncWebhookMessage
+~~~~~~~~~~~~~~~~~~~
+
+.. attributetable:: SyncWebhookMessage
-.. autoclass:: RequestsWebhookAdapter
+.. autoclass:: SyncWebhookMessage()
:members:
.. _discord_api_abcs: