Explorar o código

v2 use datetime (#206)

Juan Simon .D %!s(int64=3) %!d(string=hai) anos
pai
achega
b9c9791432
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      wbb/utils/functions.py

+ 2 - 2
wbb/utils/functions.py

@@ -160,7 +160,7 @@ def get_urls_from_text(text: str) -> bool:
     return [x[0] for x in findall(regex, str(text))]
 
 
-async def time_converter(message: Message, time_value: str) -> int:
+async def time_converter(message: Message, time_value: str) -> datetime:
     unit = ["m", "h", "d"]  # m == minutes | h == hours | d == days
     check_unit = "".join(list(filter(time_value[-1].lower().endswith, unit)))
     currunt_time = datetime.now()
@@ -175,7 +175,7 @@ async def time_converter(message: Message, time_value: str) -> int:
         temp_time = currunt_time + timedelta(days=int(time_digit))
     else:
         return await message.reply_text("Incorrect time specified.")
-    return int(datetime.timestamp(temp_time))
+    return temp_time
 
 
 async def extract_userid(message, text: str):