|
|
@ -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 |
|
|
|