diff options
Diffstat (limited to 'bot/exts/evergreen/timed.py')
-rw-r--r-- | bot/exts/evergreen/timed.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/evergreen/timed.py b/bot/exts/evergreen/timed.py index 0537141b..58da3dc8 100644 --- a/bot/exts/evergreen/timed.py +++ b/bot/exts/evergreen/timed.py @@ -8,9 +8,6 @@ from discord.ext import commands class TimedCommands(commands.Cog): """Time the command execution of a command.""" - def __init__(self, bot: commands.Bot) -> None: - self.bot = bot - @staticmethod async def create_execution_context(ctx: commands.Context, command: str) -> commands.Context: """Get a new execution context for a command.""" @@ -24,6 +21,9 @@ class TimedCommands(commands.Cog): """Time the command execution of a command.""" new_ctx = await self.create_execution_context(ctx, command) + if new_ctx.command and new_ctx.command.qualified_name == "timed": + return await ctx.send("You are not allowed to time the execution of the `timed` command.") + t_start = perf_counter() await new_ctx.command.invoke(new_ctx) t_end = perf_counter() |