Raise error if time is not str and int

This commit is contained in:
KnugiHK
2023-06-10 19:54:09 +08:00
parent 8d036a6d87
commit c419dd5d39

View File

@@ -37,6 +37,8 @@ class Message():
self.time = datetime.fromtimestamp(time/1000).strftime("%H:%M")
elif isinstance(time, str):
self.time = time
else:
raise TypeError("Time must be a string or integer")
self.media = False
self.key_id = key_id
self.meta = False