Remove deprecated checks in checks module (#6016)

This commit is contained in:
Draper 2023-04-13 22:15:22 +01:00 committed by GitHub
parent d47c91cca8
commit 896d5e9200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,3 @@
import warnings
from typing import Awaitable, TYPE_CHECKING, Dict
from .commands import ( from .commands import (
bot_has_permissions, bot_has_permissions,
bot_in_a_guild, bot_in_a_guild,
@ -13,14 +10,7 @@ from .commands import (
mod, mod,
mod_or_permissions, mod_or_permissions,
) )
from .utils.mod import (
is_mod_or_superior as _is_mod_or_superior,
is_admin_or_superior as _is_admin_or_superior,
check_permissions as _check_permissions,
)
if TYPE_CHECKING:
from .commands import Context
__all__ = [ __all__ = [
"bot_has_permissions", "bot_has_permissions",
@ -33,37 +23,4 @@ __all__ = [
"admin_or_permissions", "admin_or_permissions",
"mod", "mod",
"mod_or_permissions", "mod_or_permissions",
"is_mod_or_superior",
"is_admin_or_superior",
"check_permissions",
] ]
def is_mod_or_superior(ctx: "Context") -> Awaitable[bool]:
warnings.warn(
"`redbot.core.checks.is_mod_or_superior` is deprecated and will be removed in a future "
"release, please use `redbot.core.utils.mod.is_mod_or_superior` instead.",
category=DeprecationWarning,
stacklevel=2,
)
return _is_mod_or_superior(ctx.bot, ctx.author)
def is_admin_or_superior(ctx: "Context") -> Awaitable[bool]:
warnings.warn(
"`redbot.core.checks.is_admin_or_superior` is deprecated and will be removed in a future "
"release, please use `redbot.core.utils.mod.is_admin_or_superior` instead.",
category=DeprecationWarning,
stacklevel=2,
)
return _is_admin_or_superior(ctx.bot, ctx.author)
def check_permissions(ctx: "Context", perms: Dict[str, bool]) -> Awaitable[bool]:
warnings.warn(
"`redbot.core.checks.check_permissions` is deprecated and will be removed in a future "
"release, please use `redbot.core.utils.mod.check_permissions`.",
DeprecationWarning,
stacklevel=2,
)
return _check_permissions(ctx, perms)