diff --git a/bot/pluralkit/commands.py b/bot/pluralkit/commands.py index 4982aa74..9a8e2296 100644 --- a/bot/pluralkit/commands.py +++ b/bot/pluralkit/commands.py @@ -294,7 +294,13 @@ async def member_set(conn, message, member, args): try: value = datetime.strptime(value, "%Y-%m-%d").date() except ValueError: - return False, "Invalid date. Date must be in ISO-8601 format (eg. 1999-07-25)." + try: + # Try again, adding 0001 as a placeholder year + # This is considered a "null year" and will be omitted from the info card + # Useful if you want your birthday to be displayed yearless. + value = value = datetime.strptime("0001-" + value, "%Y-%m-%d").date() + except ValueError: + return False, "Invalid date. Date must be in ISO-8601 format (eg. 1999-07-25)." if prop == "avatar": user = await parse_mention(value) diff --git a/bot/pluralkit/help.py b/bot/pluralkit/help.py index 61615432..79463cb7 100644 --- a/bot/pluralkit/help.py +++ b/bot/pluralkit/help.py @@ -62,6 +62,7 @@ For example: `pk;member set John color #ff0000` - Changes John's color to red. `pk;member set John pronouns he/him` - Changes John's pronouns. `pk;member set John birthdate 1996-02-27` - Changes John's birthdate to Feb 27, 1996. (Must be YYYY-MM-DD format). +`pk;member set John birthdate 02-27` - Changes John's birthdate to February 27th, with no year. `pk;member set John avatar https://placekitten.com/400/400` - Changes John's avatar to a linked image. `pk;member set John avatar @JohnsAccount` - Changes John's avatar to the avatar of the mentioned account."""), ("Removing a member",