Prepare for the discord.com domain rename
This commit is contained in:
@@ -406,7 +406,7 @@ class Client:
|
||||
.. warning::
|
||||
|
||||
Logging on with a user token is against the Discord
|
||||
`Terms of Service <https://support.discordapp.com/hc/en-us/articles/115002192352>`_
|
||||
`Terms of Service <https://support.discord.com/hc/en-us/articles/115002192352>`_
|
||||
and doing so might potentially get your account banned.
|
||||
Use this at your own risk.
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ class Embed:
|
||||
|
||||
You can find out about this format in the `official Discord documentation`__.
|
||||
|
||||
.. _DiscordDocs: https://discordapp.com/developers/docs/resources/channel#embed-object
|
||||
.. _DiscordDocs: https://discord.com/developers/docs/resources/channel#embed-object
|
||||
|
||||
__ DiscordDocs_
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ class MessageConverter(Converter):
|
||||
async def convert(self, ctx, argument):
|
||||
id_regex = re.compile(r'^(?:(?P<channel_id>[0-9]{15,21})-)?(?P<message_id>[0-9]{15,21})$')
|
||||
link_regex = re.compile(
|
||||
r'^https?://(?:(ptb|canary)\.)?discordapp\.com/channels/'
|
||||
r'^https?://(?:(ptb|canary)\.)?discord(?:app)?\.com/channels/'
|
||||
r'(?:([0-9]{15,21})|(@me))'
|
||||
r'/(?P<channel_id>[0-9]{15,21})/(?P<message_id>[0-9]{15,21})/?$'
|
||||
)
|
||||
|
||||
@@ -50,7 +50,7 @@ async def json_or_text(response):
|
||||
return text
|
||||
|
||||
class Route:
|
||||
BASE = 'https://discordapp.com/api/v7'
|
||||
BASE = 'https://discord.com/api/v7'
|
||||
|
||||
def __init__(self, method, path, **parameters):
|
||||
self.path = path
|
||||
|
||||
@@ -620,7 +620,7 @@ class Message:
|
||||
def jump_url(self):
|
||||
""":class:`str`: Returns a URL that allows the client to jump to this message."""
|
||||
guild_id = getattr(self.guild, 'id', '@me')
|
||||
return 'https://discordapp.com/channels/{0}/{1.channel.id}/{1.id}'.format(guild_id, self)
|
||||
return 'https://discord.com/channels/{0}/{1.channel.id}/{1.id}'.format(guild_id, self)
|
||||
|
||||
def is_system(self):
|
||||
""":class:`bool`: Whether the message is a system message.
|
||||
|
||||
@@ -95,7 +95,7 @@ class RawMessageUpdateEvent(_RawReprMixin):
|
||||
.. versionadded:: 1.3
|
||||
|
||||
data: :class:`dict`
|
||||
The raw data given by the `gateway <https://discordapp.com/developers/docs/topics/gateway#message-update>`_
|
||||
The raw data given by the `gateway <https://discord.com/developers/docs/topics/gateway#message-update>`_
|
||||
cached_message: Optional[:class:`Message`]
|
||||
The cached message, if found in the internal message cache.
|
||||
"""
|
||||
|
||||
@@ -144,7 +144,7 @@ def oauth_url(client_id, permissions=None, guild=None, redirect_uri=None):
|
||||
redirect_uri: :class:`str`
|
||||
An optional valid redirect URI.
|
||||
"""
|
||||
url = 'https://discordapp.com/oauth2/authorize?client_id={}&scope=bot'.format(client_id)
|
||||
url = 'https://discord.com/oauth2/authorize?client_id={}&scope=bot'.format(client_id)
|
||||
if permissions is not None:
|
||||
url = url + '&permissions=' + str(permissions.value)
|
||||
if guild is not None:
|
||||
|
||||
@@ -53,7 +53,7 @@ class WebhookAdapter:
|
||||
The webhook that owns this adapter.
|
||||
"""
|
||||
|
||||
BASE = 'https://discordapp.com/api/v7'
|
||||
BASE = 'https://discord.com/api/v7'
|
||||
|
||||
def _prepare(self, webhook):
|
||||
self._webhook_id = webhook.id
|
||||
@@ -454,7 +454,7 @@ class Webhook:
|
||||
@property
|
||||
def url(self):
|
||||
"""Returns the webhook's url."""
|
||||
return 'https://discordapp.com/api/webhooks/{}/{}'.format(self.id, self.token)
|
||||
return 'https://discord.com/api/webhooks/{}/{}'.format(self.id, self.token)
|
||||
|
||||
@classmethod
|
||||
def partial(cls, id, token, *, adapter):
|
||||
@@ -504,7 +504,7 @@ class Webhook:
|
||||
The URL is invalid.
|
||||
"""
|
||||
|
||||
m = re.search(r'discordapp.com/api/webhooks/(?P<id>[0-9]{17,21})/(?P<token>[A-Za-z0-9\.\-\_]{60,68})', url)
|
||||
m = re.search(r'discord(?:app)?.com/api/webhooks/(?P<id>[0-9]{17,21})/(?P<token>[A-Za-z0-9\.\-\_]{60,68})', url)
|
||||
if m is None:
|
||||
raise InvalidArgument('Invalid webhook URL given.')
|
||||
data = m.groupdict()
|
||||
|
||||
@@ -226,7 +226,7 @@ class Widget:
|
||||
@property
|
||||
def json_url(self):
|
||||
""":class:`str`: The JSON URL of the widget."""
|
||||
return "https://discordapp.com/api/guilds/{0.id}/widget.json".format(self)
|
||||
return "https://discord.com/api/guilds/{0.id}/widget.json".format(self)
|
||||
|
||||
@property
|
||||
def invite_url(self):
|
||||
|
||||
Reference in New Issue
Block a user