aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/utilities/epoch.py
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-09-23 22:58:49 +0100
committerGravatar GitHub <[email protected]>2022-09-23 22:58:49 +0100
commitf9cc77f55a7bac9cff1f5674b36b3f17560f6bfe (patch)
tree4d9a9684d6c0d8f1f749355353fbadb7fd89960b /bot/exts/utilities/epoch.py
parentFix issue #1050 (#1097) (diff)
parentRemove all wait_until_guil_available as this is now done in bot-core (diff)
Merge pull request #1092 from python-discord/bot-core-migration
Diffstat (limited to 'bot/exts/utilities/epoch.py')
-rw-r--r--bot/exts/utilities/epoch.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/bot/exts/utilities/epoch.py b/bot/exts/utilities/epoch.py
index 42312dd1..bf67067c 100644
--- a/bot/exts/utilities/epoch.py
+++ b/bot/exts/utilities/epoch.py
@@ -6,7 +6,6 @@ from dateutil import parser
from discord.ext import commands
from bot.bot import Bot
-from bot.utils.extensions import invoke_help_command
# https://discord.com/developers/docs/reference#message-formatting-timestamp-styles
STYLES = {
@@ -48,6 +47,9 @@ class DateString(commands.Converter):
class Epoch(commands.Cog):
"""Convert an entered time and date to a unix timestamp."""
+ def __init__(self, bot: Bot) -> None:
+ self.bot = bot
+
@commands.command(name="epoch")
async def epoch(self, ctx: commands.Context, *, date_time: DateString = None) -> None:
"""
@@ -71,7 +73,7 @@ class Epoch(commands.Cog):
Times in the dropdown are shown in UTC
"""
if not date_time:
- await invoke_help_command(ctx)
+ await self.bot.invoke_help_command(ctx)
return
if isinstance(date_time, tuple):
@@ -133,6 +135,6 @@ class TimestampMenuView(discord.ui.View):
return True
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Epoch cog."""
- bot.add_cog(Epoch())
+ await bot.add_cog(Epoch(bot))