aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/timed.py
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2021-05-15 23:41:20 +0200
committerGravatar GitHub <[email protected]>2021-05-15 23:41:20 +0200
commite6e280cd13236647ffcaa35f522baeb747fbf97e (patch)
treea888762bcd97704f57ad33e8e1bd0d179c3abd2b /bot/exts/evergreen/timed.py
parentMerge pull request #737 from python-discord/latex-don't-load-cog (diff)
parentchore: Apply Iceman's suggestions (diff)
Spring cleanup (#718)
This PR changes a ton of various different bits and pieces. Please see #718 for more information.
Diffstat (limited to 'bot/exts/evergreen/timed.py')
-rw-r--r--bot/exts/evergreen/timed.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/bot/exts/evergreen/timed.py b/bot/exts/evergreen/timed.py
index 5f177fd6..2ea6b419 100644
--- a/bot/exts/evergreen/timed.py
+++ b/bot/exts/evergreen/timed.py
@@ -4,6 +4,8 @@ from time import perf_counter
from discord import Message
from discord.ext import commands
+from bot.bot import Bot
+
class TimedCommands(commands.Cog):
"""Time the command execution of a command."""
@@ -16,7 +18,7 @@ class TimedCommands(commands.Cog):
return await ctx.bot.get_context(msg)
- @commands.command(name="timed", aliases=["time", "t"])
+ @commands.command(name="timed", aliases=("time", "t"))
async def timed(self, ctx: commands.Context, *, command: str) -> None:
"""Time the command execution of a command."""
new_ctx = await self.create_execution_context(ctx, command)
@@ -41,6 +43,6 @@ class TimedCommands(commands.Cog):
await ctx.send(f"Command execution for `{new_ctx.command}` finished in {(t_end - t_start):.4f} seconds.")
-def setup(bot: commands.Bot) -> None:
- """Cog load."""
- bot.add_cog(TimedCommands(bot))
+def setup(bot: Bot) -> None:
+ """Load the Timed cog."""
+ bot.add_cog(TimedCommands())