simplify /timestamp to single Long Date+Time output, fix timestamp_friends HAS_DATEPARSER NameError

This commit is contained in:
esef committed 2026-07-22 18:26:03 +03:00
1 parent bf4ea13d4b
commit 09f69e1c83
2 files changed
+3 -8

No files matched your search

+3 -6
View File
@@ -148,16 +148,13 @@ class TimestampModal(discord.ui.Modal, title="Timestamp Converter"):
).replace(tzinfo=tz) ).replace(tzinfo=tz)
unix_ts = int(local_dt.astimezone(timezone.utc).timestamp()) unix_ts = int(local_dt.astimezone(timezone.utc).timestamp())
# --- output all formats --- # --- output single Long Date+Time format ---
lines = [ lines = [
f"**{local_dt.strftime('%d %B at %H:%M')}**", f"**{local_dt.strftime('%d %B at %H:%M')}**",
f"Unix: `{unix_ts}`", f"`<t:{unix_ts}:F>` ← Long Date+Time",
"", "",
"*Times display in each viewer's local timezone.*",
] ]
for label, tag in _all_formats(unix_ts):
lines.append(f"`{tag}` ← {label}")
lines.append("")
lines.append("*Copy the tag you want — times display in each viewer's local timezone.*")
await interaction.response.send_message( await interaction.response.send_message(
"\n".join(lines), "\n".join(lines),
-2
View File
@@ -80,8 +80,6 @@ class TimestampFriends(commands.Cog):
# --- quick bail-outs --- # --- quick bail-outs ---
if message.author.bot: if message.author.bot:
return return
if not HAS_DATEPARSER:
return
if message.author.id not in self.friends: if message.author.id not in self.friends:
return return
if not _TRIGGER_RE.search(message.content): if not _TRIGGER_RE.search(message.content):