aboutsummaryrefslogtreecommitdiff
path: root/discord/webhook.py
diff options
context:
space:
mode:
authorSebastian Law <[email protected]>2020-06-28 00:45:58 -0700
committerGitHub <[email protected]>2020-06-28 03:45:58 -0400
commitb4b953bfc66adc235e06774b0481ceb847753793 (patch)
tree2d0cbd871944e3a5184b2dbec75dc59ddabad6d5 /discord/webhook.py
parentFix a KeyError for channels with no category in Guild.by_category (diff)
downloaddiscord.py-b4b953bfc66adc235e06774b0481ceb847753793.tar.xz
discord.py-b4b953bfc66adc235e06774b0481ceb847753793.zip
Fix various inconsistencies within the documentation (#5067)
Diffstat (limited to 'discord/webhook.py')
-rw-r--r--discord/webhook.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/discord/webhook.py b/discord/webhook.py
index a45d27e0..7a7bf950 100644
--- a/discord/webhook.py
+++ b/discord/webhook.py
@@ -453,15 +453,13 @@ class Webhook:
@property
def url(self):
- """Returns the webhook's url."""
+ """:class:`str` : Returns the webhook's url."""
return 'https://discord.com/api/webhooks/{}/{}'.format(self.id, self.token)
@classmethod
def partial(cls, id, token, *, adapter):
"""Creates a partial :class:`Webhook`.
- A partial webhook is just a webhook object with an ID and a token.
-
Parameters
-----------
id: :class:`int`
@@ -472,6 +470,12 @@ class Webhook:
The webhook adapter to use when sending requests. This is
typically :class:`AsyncWebhookAdapter` for :doc:`aiohttp <aio:index>` or
:class:`RequestsWebhookAdapter` for :doc:`req:index`.
+
+ Returns
+ --------
+ :class:`Webhook`
+ A partial :class:`Webhook`.
+ A partial webhook is just a webhook object with an ID and a token.
"""
if not isinstance(adapter, WebhookAdapter):
@@ -502,6 +506,12 @@ class Webhook:
-------
InvalidArgument
The URL is invalid.
+
+ Returns
+ --------
+ :class:`Webhook`
+ A partial :class:`Webhook`.
+ A partial webhook is just a webhook object with an ID and a token.
"""
m = re.search(r'discord(?:app)?.com/api/webhooks/(?P<id>[0-9]{17,21})/(?P<token>[A-Za-z0-9\.\-\_]{60,68})', url)
@@ -560,7 +570,7 @@ class Webhook:
@property
def avatar_url(self):
- """Returns an :class:`Asset` for the avatar the webhook has.
+ """:class:`Asset`: 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.