diff options
| author | 2021-04-10 21:48:26 +0100 | |
|---|---|---|
| committer | 2021-04-10 21:48:26 +0100 | |
| commit | d7263238b68a3d55f47ec944cc9e85450e2800b6 (patch) | |
| tree | e4e5851601f710721864f8b89fa6ecb196ba3199 /bot | |
| parent | add timed command for timed execution of commands (diff) | |
removed unused cog init and fixed timing timed command
Diffstat (limited to 'bot')
| -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()  |