Use the commands module instead of checks for permission decorators (#5463)

Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
This commit is contained in:
Kreusada
2023-04-13 19:16:12 +01:00
committed by GitHub
parent a70f444255
commit 79d11e947c
35 changed files with 238 additions and 249 deletions

View File

@@ -24,7 +24,7 @@ from copy import copy
import discord
from . import checks, commands
from . import commands
from .commands import NoParseOptional as Optional
from .i18n import Translator, cog_i18n
from .utils import chat_formatting
@@ -124,7 +124,7 @@ class Dev(commands.Cog):
return env
@commands.command()
@checks.is_owner()
@commands.is_owner()
async def debug(self, ctx, *, code):
"""Evaluate a statement of python code.
@@ -172,7 +172,7 @@ class Dev(commands.Cog):
await ctx.send_interactive(self.get_pages(result), box_lang="py")
@commands.command(name="eval")
@checks.is_owner()
@commands.is_owner()
async def _eval(self, ctx, *, body: str):
"""Execute asynchronous code.
@@ -230,7 +230,7 @@ class Dev(commands.Cog):
await ctx.send_interactive(self.get_pages(msg), box_lang="py")
@commands.group(invoke_without_command=True)
@checks.is_owner()
@commands.is_owner()
async def repl(self, ctx):
"""Open an interactive REPL.
@@ -361,7 +361,7 @@ class Dev(commands.Cog):
@commands.guild_only()
@commands.command()
@checks.is_owner()
@commands.is_owner()
async def mock(self, ctx, user: discord.Member, *, command):
"""Mock another user invoking a command.
@@ -375,7 +375,7 @@ class Dev(commands.Cog):
@commands.guild_only()
@commands.command(name="mockmsg")
@checks.is_owner()
@commands.is_owner()
async def mock_msg(self, ctx, user: discord.Member, *, content: str = ""):
"""Dispatch a message event as if it were sent by a different user.
@@ -396,7 +396,7 @@ class Dev(commands.Cog):
ctx.bot.dispatch("message", msg)
@commands.command()
@checks.is_owner()
@commands.is_owner()
async def bypasscooldowns(self, ctx, toggle: Optional[bool] = None):
"""Give bot owners the ability to bypass cooldowns.