mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Omit year if year is considered invalid
This commit is contained in:
parent
af4f2025da
commit
f9a7bee99d
1 changed files with 5 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ from pluralkit import db
|
||||||
from pluralkit.bot import client, logger
|
from pluralkit.bot import client, logger
|
||||||
|
|
||||||
def escape(s):
|
def escape(s):
|
||||||
return s.replace("`", "\`")
|
return s.replace("`", "\\`")
|
||||||
|
|
||||||
def generate_hid() -> str:
|
def generate_hid() -> str:
|
||||||
return "".join(random.choices(string.ascii_lowercase, k=5))
|
return "".join(random.choices(string.ascii_lowercase, k=5))
|
||||||
|
|
@ -257,8 +257,10 @@ async def generate_member_info_card(conn, member: asyncpg.Record) -> discord.Emb
|
||||||
card.colour = int(member["color"], 16)
|
card.colour = int(member["color"], 16)
|
||||||
|
|
||||||
if member["birthday"]:
|
if member["birthday"]:
|
||||||
card.add_field(name="Birthdate",
|
bday_val = member["birthday"].strftime("%b %d, %Y")
|
||||||
value=member["birthday"].strftime("%b %d, %Y"))
|
if member["birthday"].year < 1000:
|
||||||
|
bday_val = member["birthday"].strftime("%b %d")
|
||||||
|
card.add_field(name="Birthdate", value=bday_val)
|
||||||
|
|
||||||
if member["pronouns"]:
|
if member["pronouns"]:
|
||||||
card.add_field(name="Pronouns", value=member["pronouns"])
|
card.add_field(name="Pronouns", value=member["pronouns"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue