aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
Diffstat (limited to 'discord')
-rw-r--r--discord/template.py4
-rw-r--r--discord/utils.py19
2 files changed, 19 insertions, 4 deletions
diff --git a/discord/template.py b/discord/template.py
index dfc35972..24c45567 100644
--- a/discord/template.py
+++ b/discord/template.py
@@ -84,7 +84,7 @@ class Template:
code: :class:`str`
The template code.
uses: :class:`int`
- How many time the template has been used.
+ How many times the template has been used.
name: :class:`str`
The name of the template.
description: :class:`str`
@@ -95,7 +95,7 @@ class Template:
When the template was created.
updated_at: :class:`datetime.datetime`
When the template was last updated (referred to as "last synced" in the client).
- source_guild: :class:`TemplateGuild`
+ source_guild: :class:`Guild`
The source guild.
"""
diff --git a/discord/utils.py b/discord/utils.py
index e42f5679..a6f3897e 100644
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -429,11 +429,11 @@ def _string_width(string, *, _IS_ASCII=_IS_ASCII):
def resolve_invite(invite):
"""
- Resolves an invite from a :class:`~discord.Invite`, URL or ID
+ Resolves an invite from a :class:`~discord.Invite`, URL or code.
Parameters
-----------
- invite: Union[:class:`~discord.Invite`, :class:`~discord.Object`, :class:`str`]
+ invite: Union[:class:`~discord.Invite`, :class:`str`]
The invite.
Returns
@@ -452,6 +452,21 @@ def resolve_invite(invite):
return invite
def resolve_template(code):
+ """
+ Resolves a template code from a :class:`~discord.Template`, URL or code.
+
+ .. versionadded:: 1.4
+
+ Parameters
+ -----------
+ code: Union[:class:`~discord.Template`, :class:`str`]
+ The code.
+
+ Returns
+ --------
+ :class:`str`
+ The template code.
+ """
from .template import Template # circular import
if isinstance(code, Template):
return template.code