[Core] Use new PyPI urls (#3607)

* fix: use new PyPI urls

* Update core_commands.py

* Update core_commands.py
This commit is contained in:
jack1142 2020-02-28 02:43:21 +01:00 committed by GitHub
parent ad4a75bdc1
commit e8b975a095
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -310,7 +310,8 @@ class Core(commands.Cog, CoreLogic):
author_repo = "https://github.com/Twentysix26" author_repo = "https://github.com/Twentysix26"
org_repo = "https://github.com/Cog-Creators" org_repo = "https://github.com/Cog-Creators"
red_repo = org_repo + "/Red-DiscordBot" red_repo = org_repo + "/Red-DiscordBot"
red_pypi = "https://pypi.python.org/pypi/Red-DiscordBot" red_pypi = "https://pypi.org/project/Red-DiscordBot"
red_pypi_json = "https://pypi.org/pypi/Red-DiscordBot/json"
support_server_url = "https://discord.gg/red" support_server_url = "https://discord.gg/red"
dpy_repo = "https://github.com/Rapptz/discord.py" dpy_repo = "https://github.com/Rapptz/discord.py"
python_url = "https://www.python.org/" python_url = "https://www.python.org/"
@ -327,7 +328,7 @@ class Core(commands.Cog, CoreLogic):
custom_info = await self.bot._config.custom_info() custom_info = await self.bot._config.custom_info()
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.get("{}/json".format(red_pypi)) as r: async with session.get(red_pypi_json) as r:
data = await r.json() data = await r.json()
outdated = VersionInfo.from_str(data["info"]["version"]) > red_version_info outdated = VersionInfo.from_str(data["info"]["version"]) > red_version_info
about = _( about = _(

View File

@ -86,7 +86,7 @@ def init_events(bot, cli_flags):
outdated_red_message = "" outdated_red_message = ""
with contextlib.suppress(aiohttp.ClientError, discord.HTTPException): with contextlib.suppress(aiohttp.ClientError, discord.HTTPException):
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.get("https://pypi.python.org/pypi/red-discordbot/json") as r: async with session.get("https://pypi.org/pypi/red-discordbot/json") as r:
data = await r.json() data = await r.json()
if VersionInfo.from_str(data["info"]["version"]) > red_version_info: if VersionInfo.from_str(data["info"]["version"]) > red_version_info:
INFO.append( INFO.append(