aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/utilities/epoch.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/utilities/epoch.py')
-rw-r--r--bot/exts/utilities/epoch.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bot/exts/utilities/epoch.py b/bot/exts/utilities/epoch.py
index b9feed18..42312dd1 100644
--- a/bot/exts/utilities/epoch.py
+++ b/bot/exts/utilities/epoch.py
@@ -35,7 +35,7 @@ class DateString(commands.Converter):
"""
try:
return arrow.utcnow().dehumanize(argument)
- except ValueError:
+ except (ValueError, OverflowError):
try:
dt, ignored_tokens = parser.parse(argument, fuzzy_with_tokens=True)
except parser.ParserError:
@@ -86,7 +86,10 @@ class Epoch(commands.Cog):
view = TimestampMenuView(ctx, self._format_dates(date_time), epoch)
original = await ctx.send(f"`{epoch}`", view=view)
await view.wait() # wait until expiration before removing the dropdown
- await original.edit(view=None)
+ try:
+ await original.edit(view=None)
+ except discord.NotFound: # disregard the error message if the message is deleled
+ pass
@staticmethod
def _format_dates(date: arrow.Arrow) -> list[str]: