Check platform to change format string

This commit is contained in:
Zeva Rose 2022-02-04 13:18:39 -07:00
parent ace64e9ad9
commit 43ff9fce5d

View file

@ -1,4 +1,5 @@
"""J.A.R.V.I.S. Utility Cog."""
import platform
import re
import secrets
import string
@ -179,15 +180,18 @@ class UtilCog(Scale):
user_roles = user.roles
if user_roles:
user_roles = sorted(user.roles, key=lambda x: -x.position)
format_string = "%a, %b %-d, %Y %-I:%M %p"
if platform.system() == "Windows":
format_string = "%a, %b %#d, %Y %#I:%M %p"
fields = [
EmbedField(
name="Joined",
value=user.joined_at.strftime("%a, %b %#d, %Y %#I:%M %p"),
value=user.joined_at.strftime(format_string),
),
EmbedField(
name="Registered",
value=user.created_at.strftime("%a, %b %#d, %Y %#I:%M %p"),
value=user.created_at.strftime(format_string),
),
EmbedField(
name=f"Roles [{len(user_roles)}]",