mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
Remove things past deprecation time (2020-08-05) (#4163)
This commit is contained in:
@@ -5,8 +5,7 @@
|
||||
import asyncio
|
||||
import contextlib
|
||||
import functools
|
||||
import warnings
|
||||
from typing import Iterable, List, Optional, Union
|
||||
from typing import Iterable, List, Union
|
||||
import discord
|
||||
|
||||
from .. import commands
|
||||
@@ -170,9 +169,7 @@ async def close_menu(
|
||||
|
||||
|
||||
def start_adding_reactions(
|
||||
message: discord.Message,
|
||||
emojis: Iterable[_ReactableEmoji],
|
||||
loop: Optional[asyncio.AbstractEventLoop] = None,
|
||||
message: discord.Message, emojis: Iterable[_ReactableEmoji],
|
||||
) -> asyncio.Task:
|
||||
"""Start adding reactions to a message.
|
||||
|
||||
@@ -184,18 +181,12 @@ def start_adding_reactions(
|
||||
reaction whilst the reactions are still being added - in fact,
|
||||
this is exactly what `menu` uses to do that.
|
||||
|
||||
This spawns a `asyncio.Task` object and schedules it on ``loop``.
|
||||
If ``loop`` omitted, the loop will be retrieved with
|
||||
`asyncio.get_event_loop`.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
message: discord.Message
|
||||
The message to add reactions to.
|
||||
emojis : Iterable[Union[str, discord.Emoji]]
|
||||
The emojis to react to the message with.
|
||||
loop : Optional[asyncio.AbstractEventLoop]
|
||||
The event loop.
|
||||
|
||||
Returns
|
||||
-------
|
||||
@@ -210,17 +201,7 @@ def start_adding_reactions(
|
||||
for emoji in emojis:
|
||||
await message.add_reaction(emoji)
|
||||
|
||||
if loop is None:
|
||||
loop = asyncio.get_running_loop()
|
||||
else:
|
||||
warnings.warn(
|
||||
"`loop` kwarg is deprecated since Red 3.3.1. It is currently being ignored"
|
||||
" and will be removed in the first minor release after 2020-08-05.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
return loop.create_task(task())
|
||||
return asyncio.create_task(task())
|
||||
|
||||
|
||||
DEFAULT_CONTROLS = {
|
||||
|
||||
Reference in New Issue
Block a user