Update d.py to 1.6.0, aiohttp to 3.7.3, Red-Lavalink to 0.7.2 (#4728)

* Bump d.py, aiohttp, Red-Lavalink

* Remove deprecation warnings that are no longer relevant

* Max concurrency things in `Command.prepare()`

* Two random things that date back to times older than d.py 1.1...
This commit is contained in:
jack1142 2021-02-01 14:49:50 +01:00 committed by GitHub
parent d6de9c1b94
commit 8139587e5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 26 deletions

View File

@ -204,12 +204,3 @@ if "--debug" not in _sys.argv:
# Individual warnings - tracked in https://github.com/Cog-Creators/Red-DiscordBot/issues/3529
# DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
_warnings.filterwarnings("ignore", category=DeprecationWarning, module="importlib", lineno=219)
# DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
# def noop(*args, **kwargs): # type: ignore
_warnings.filterwarnings("ignore", category=DeprecationWarning, module="aiohttp", lineno=107)
# DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
# hosts = await asyncio.shield(self._resolve_host(..
_warnings.filterwarnings("ignore", category=DeprecationWarning, module="aiohttp", lineno=964)
# DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
# self._event = asyncio.Event(loop=loop)
_warnings.filterwarnings("ignore", category=DeprecationWarning, module="aiohttp", lineno=21)

View File

@ -485,15 +485,22 @@ class Command(CogCommandMixin, DPYCommand):
if not await self.can_run(ctx, change_permission_state=True):
raise CheckFailure(f"The check functions for command {self.qualified_name} failed.")
if self.cooldown_after_parsing:
await self._parse_arguments(ctx)
self._prepare_cooldowns(ctx)
else:
self._prepare_cooldowns(ctx)
await self._parse_arguments(ctx)
if self._max_concurrency is not None:
await self._max_concurrency.acquire(ctx)
await self.call_before_hooks(ctx)
try:
if self.cooldown_after_parsing:
await self._parse_arguments(ctx)
self._prepare_cooldowns(ctx)
else:
self._prepare_cooldowns(ctx)
await self._parse_arguments(ctx)
await self.call_before_hooks(ctx)
except:
if self._max_concurrency is not None:
await self._max_concurrency.release(ctx)
raise
async def do_conversion(
self, ctx: "Context", converter, argument: str, param: inspect.Parameter

View File

@ -188,7 +188,7 @@ class Context(DPYContext):
else:
try:
await self.channel.delete_messages((query, resp))
except (discord.HTTPException, AttributeError):
except discord.HTTPException:
# In case the bot can't delete other users' messages,
# or is not a bot account
# or channel is a DM

View File

@ -546,15 +546,11 @@ class Case:
if message is None:
message_id = data.get("message")
if message_id is not None:
try:
message = discord.utils.get(bot.cached_messages, id=message_id)
except AttributeError:
# bot.cached_messages didn't exist prior to discord.py 1.1.0
message = None
message = discord.utils.get(bot.cached_messages, id=message_id)
if message is None:
try:
message = await mod_channel.fetch_message(message_id)
except (discord.HTTPException, AttributeError):
except discord.HTTPException:
message = None
else:
message = None

View File

@ -32,7 +32,7 @@ classifiers =
packages = find_namespace:
python_requires = >=3.8.1,<3.9
install_requires =
aiohttp==3.6.2
aiohttp==3.7.3
aiohttp-json-rpc==0.13.2
aiosqlite==0.15.0
appdirs==1.4.4
@ -45,7 +45,7 @@ install_requires =
colorama==0.4.3
commonmark==0.9.1
contextlib2==0.6.0.post1
discord.py==1.5.1
discord.py==1.6.0
distro==1.5.0; sys_platform == "linux"
fuzzywuzzy==0.18.0
idna==2.10
@ -56,7 +56,7 @@ install_requires =
python-Levenshtein-wheels==0.13.1
pytz==2020.1
PyYAML==5.3.1
Red-Lavalink==0.7.1
Red-Lavalink==0.7.2
rich==9.5.1
schema==0.7.2
six==1.15.0