From b7f1ca716dbf59a26282f14b3c5d39fbb8bded3d Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Mon, 26 Oct 2020 12:43:34 -0700 Subject: [PATCH] [Tools] Fix for join time with no ms --- tools/tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/tools.py b/tools/tools.py index 506cff1..c8acfa9 100644 --- a/tools/tools.py +++ b/tools/tools.py @@ -756,7 +756,11 @@ class Tools(commands.Cog): @staticmethod def _dynamic_time(time): - date_join = datetime.datetime.strptime(str(time), "%Y-%m-%d %H:%M:%S.%f") + try: + date_join = datetime.datetime.strptime(str(time), "%Y-%m-%d %H:%M:%S.%f") + except ValueError: + member_created_at = f"{str(member.created_at)}.0" + date_join = datetime.datetime.strptime(str(time), "%Y-%m-%d %H:%M:%S.%f") date_now = datetime.datetime.now(datetime.timezone.utc) date_now = date_now.replace(tzinfo=None) since_join = date_now - date_join