misc/migration related
This commit is contained in:
47
cogs/misc.py
47
cogs/misc.py
@ -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()
|
||||
|
Reference in New Issue
Block a user