Switch from low-level loop.create_task and asyncio.ensure_future (#5626)

* Switch from low-level loop.create_task and asyncio.ensure_future

* Patch vendored discord.ext.menus to use modern APIs as well

That ext is no longer maintained by Danny anyway so...

* black
This commit is contained in:
jack1142
2022-03-21 17:24:46 +01:00
committed by GitHub
parent 7a5ada2d92
commit ed4f2cf466
15 changed files with 27 additions and 37 deletions

View File

@@ -144,7 +144,7 @@ class Mod(
"Ignored guilds and channels have been moved. "
"Please use {command} to migrate the old settings."
).format(command=inline("[p]moveignoredchannels"))
self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
asyncio.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
message_sent = True
break
if message_sent is False:
@@ -154,9 +154,7 @@ class Mod(
"Ignored guilds and channels have been moved. "
"Please use {command} to migrate the old settings."
).format(command=inline("[p]moveignoredchannels"))
self.bot.loop.create_task(
send_to_owners_with_prefix_replaced(self.bot, msg)
)
asyncio.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
break
await self.config.version.set("1.1.0")
if await self.config.version() < "1.2.0":
@@ -166,7 +164,7 @@ class Mod(
"Delete delay settings have been moved. "
"Please use {command} to migrate the old settings."
).format(command=inline("[p]movedeletedelay"))
self.bot.loop.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
asyncio.create_task(send_to_owners_with_prefix_replaced(self.bot, msg))
break
await self.config.version.set("1.2.0")
if await self.config.version() < "1.3.0":