misc/migration related

This commit is contained in:
2025-06-08 08:53:27 -04:00
parent 046ad4f94a
commit 75addd629c
6 changed files with 113 additions and 33 deletions

View File

@ -214,8 +214,51 @@ class Misc(commands.Cog):
except Exception as e:
logging.debug("Failed to add xmas reaction: %s", str(e))
await ctx.respond(
f"Only {days} days, {hours} hours, {minutes} minutes,\
{seconds} seconds and {ms} ms left! (UTC)".translate(xmas_trans)
f"Only {days} days, {hours} hours, {minutes} minutes, {seconds} seconds and {ms} ms left until Christmas! (UTC)".translate(
xmas_trans
)
)
except Exception as e:
traceback.print_exc()
return await ctx.respond(f"Error: {str(e)}")
@bridge.bridge_command()
async def halloween(self, ctx) -> None:
"""
Countdown til Halloween!
"""
try:
emojis: dict = {
"0": "0",
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5",
"6": "6",
"7": "7",
"8": "8",
"9": "9",
}
with ctx.channel.typing():
countdown = self.util.get_days_to_halloween()
if not isinstance(countdown, tuple) or len(countdown) < 6:
return await ctx.respond(
"Oops, Halloween is cancelled."
) # Invalid countdown from util
(days, hours, minutes, seconds, ms, _) = countdown
now: datetime.datetime = datetime.datetime.now()
if now.month == 12 and now.day == 25:
return await ctx.respond("# IT IS HALLOWEEN!!!!!!!!\n-# GET ROWDY")
halloween_trans: dict = str.maketrans(emojis)
try:
await ctx.message.add_reaction(emoji="🎃")
except Exception as e:
logging.debug("Failed to add Halloween reaction: %s", str(e))
await ctx.respond(
f"Only {days} days, {hours} hours, {minutes} minutes, {seconds} seconds and {ms} ms left until Halloween! (UTC)".translate(
halloween_trans
)
)
except Exception as e:
traceback.print_exc()