add japanese era to birthday

we rawdogging this shit
This commit is contained in:
leander committed 2025-05-29 03:22:23 +02:00
1 parent 0d53207cf9
commit ecff4f4186
2 files changed
+6

No files matched your search

+1
View File
@@ -1,6 +1,7 @@
asyncio==3.4.*
discord.py==2.3.*
graphviz==0.20.*
Japanera==2.1.*
mcrcon==0.7.*
moviepy==1.0.*
nltk==3.9.*
+5
View File
@@ -8,6 +8,7 @@ from dateutil.relativedelta import relativedelta
from discord import app_commands
from discord.ext import commands
from discord.ext import tasks
from japanera import EraDate
from cogs.utils import discord_utils
from cogs.utils import embed_templates
@@ -314,11 +315,15 @@ class Birthday(commands.Cog):
next_birthday = self.fetch_user_next_birthday(bruker.id)
next_birthday_days = (next_birthday - datetime.now()).days
# Japanese era
japanese_era = EraDate.from_date(birthday).strftime("%-K%-y年")
embed = discord.Embed(description=bruker.mention, color=bruker.color)
embed.set_thumbnail(url=bruker.display_avatar)
embed.set_author(name=bruker.name, icon_url=bruker.display_avatar)
embed.add_field(name="Bursdag", value=discord.utils.format_dt(birthday, style="D"))
embed.add_field(name="Hvor gammel?", value=f"{years_old} år\n({days_old} dager)", inline=False)
embed.add_field(name="Weeb age", value=japanese_era, inline=False)
embed.add_field(
name="Neste bursdag om",
value=f'{next_birthday_days} {"dager" if next_birthday_days != 1 else "dag"}',