mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
Remove usage of loop arg in calls to start_adding_reactions (#3644)
* fix stacklevels of warnings * stop using loop arg when calling start_adding_reactions * [Audio] Stop using loop arg when calling start_adding_reactions
This commit is contained in:
@@ -183,6 +183,7 @@ def bounded_gather_iter(
|
||||
"Explicitly passing the loop will not work in Red 3.4+ and is currently ignored."
|
||||
"Call this from the related event loop.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
loop = asyncio.get_running_loop()
|
||||
@@ -240,6 +241,7 @@ def bounded_gather(
|
||||
"Explicitly passing the loop will not work in Red 3.4+ and is currently ignored."
|
||||
"Call this from the related event loop.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
loop = asyncio.get_running_loop()
|
||||
|
||||
@@ -78,7 +78,7 @@ async def menu(
|
||||
message = await ctx.send(current_page)
|
||||
# Don't wait for reactions to be added (GH-1797)
|
||||
# noinspection PyAsyncCall
|
||||
start_adding_reactions(message, controls.keys(), ctx.bot.loop)
|
||||
start_adding_reactions(message, controls.keys())
|
||||
else:
|
||||
try:
|
||||
if isinstance(current_page, discord.Embed):
|
||||
@@ -213,7 +213,11 @@ def start_adding_reactions(
|
||||
if loop is None:
|
||||
loop = asyncio.get_running_loop()
|
||||
else:
|
||||
warnings.warn("Explicitly passing the loop will not work in Red 3.4+", DeprecationWarning)
|
||||
warnings.warn(
|
||||
"Explicitly passing the loop will not work in Red 3.4+",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
return loop.create_task(task())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user