aboutsummaryrefslogtreecommitdiff
path: root/discord/webhook.py
diff options
context:
space:
mode:
authorNCPlayz <[email protected]>2019-05-18 06:04:54 -0400
committerRapptz <[email protected]>2019-06-07 19:27:46 -0400
commit3c9bcc285147154a2980f6e661efdfa676672b6a (patch)
tree657bafa75e4e0d45361e394443ea932ad70e86a7 /discord/webhook.py
parentAdded comment for/redo system information (diff)
downloaddiscord.py-3c9bcc285147154a2980f6e661efdfa676672b6a.tar.xz
discord.py-3c9bcc285147154a2980f6e661efdfa676672b6a.zip
Improve documentation
Diffstat (limited to 'discord/webhook.py')
-rw-r--r--discord/webhook.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/discord/webhook.py b/discord/webhook.py
index 98416e57..55448e6e 100644
--- a/discord/webhook.py
+++ b/discord/webhook.py
@@ -164,7 +164,7 @@ class AsyncWebhookAdapter(WebhookAdapter):
Parameters
-----------
- session: aiohttp.ClientSession
+ session: :class:`aiohttp.ClientSession`
The session to use to send requests.
"""
@@ -235,7 +235,7 @@ class AsyncWebhookAdapter(WebhookAdapter):
class RequestsWebhookAdapter(WebhookAdapter):
"""A webhook adapter suited for use with ``requests``.
- Only versions of requests higher than 2.13.0 are supported.
+ Only versions of :doc:`req:index` higher than 2.13.0 are supported.
Parameters
-----------
@@ -369,9 +369,9 @@ class Webhook:
it bound to a websocket connection using the :meth:`~.Webhook.from_url` or
:meth:`~.Webhook.partial` classmethods. This form allows finer grained control
over how requests are done, allowing you to mix async and sync code using either
- ``aiohttp`` or ``requests``.
+ :doc:`aiohttp <aio:index>` or :doc:`req:index`.
- For example, creating a webhook from a URL and using ``aiohttp``:
+ For example, creating a webhook from a URL and using :doc:`aiohttp <aio:index>`:
.. code-block:: python3
@@ -383,7 +383,7 @@ class Webhook:
webhook = Webhook.from_url('url-here', adapter=AsyncWebhookAdapter(session))
await webhook.send('Hello World', username='Foo')
- Or creating a webhook from an ID and token and using ``requests``:
+ Or creating a webhook from an ID and token and using :doc:`req:index`:
.. code-block:: python3
@@ -456,8 +456,8 @@ class Webhook:
The authentication token of the webhook.
adapter: :class:`WebhookAdapter`
The webhook adapter to use when sending requests. This is
- typically :class:`AsyncWebhookAdapter` for ``aiohttp`` or
- :class:`RequestsWebhookAdapter` for ``requests``.
+ typically :class:`AsyncWebhookAdapter` for :doc:`aiohttp <aio:index>` or
+ :class:`RequestsWebhookAdapter` for :doc:`req:index`.
"""
if not isinstance(adapter, WebhookAdapter):
@@ -480,8 +480,8 @@ class Webhook:
The URL of the webhook.
adapter: :class:`WebhookAdapter`
The webhook adapter to use when sending requests. This is
- typically :class:`AsyncWebhookAdapter` for ``aiohttp`` or
- :class:`RequestsWebhookAdapter` for ``requests``.
+ typically :class:`AsyncWebhookAdapter` for :doc:`aiohttp <aio:index>` or
+ :class:`RequestsWebhookAdapter` for :doc:`req:index`.
Raises
-------
@@ -518,12 +518,12 @@ class Webhook:
@property
def created_at(self):
- """Returns the webhook's creation time in UTC."""
+ """:class:`datetime.datetime`: Returns the webhook's creation time in UTC."""
return utils.snowflake_time(self.id)
@property
def avatar_url(self):
- """Returns a :class:`Asset` for the avatar the webhook has.
+ """Returns an :class:`Asset` for the avatar the webhook has.
If the webhook does not have a traditional avatar, an asset for
the default avatar is returned instead.
@@ -534,7 +534,7 @@ class Webhook:
return self.avatar_url_as()
def avatar_url_as(self, *, format=None, size=1024):
- """Returns a :class:`Asset` for the avatar the webhook has.
+ """Returns an :class:`Asset` for the avatar the webhook has.
If the webhook does not have a traditional avatar, an asset for
the default avatar is returned instead.