From cc2dcdcdbf9e6057053bdb72bba848f4c2e19cbd Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Tue, 23 Aug 2022 20:46:14 +0100 Subject: Use extension utils from bot-core --- bot/exts/utilities/epoch.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bot/exts/utilities/epoch.py') diff --git a/bot/exts/utilities/epoch.py b/bot/exts/utilities/epoch.py index 42312dd1..2a21688e 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): @@ -135,4 +137,4 @@ class TimestampMenuView(discord.ui.View): def setup(bot: Bot) -> None: """Load the Epoch cog.""" - bot.add_cog(Epoch()) + bot.add_cog(Epoch(bot)) -- cgit v1.2.3