From b84641023a0ce6920da5ba083a9659ac6221fd59 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 19 May 2017 09:30:30 +0200 Subject: [PATCH] Handle more cases where the type is a date --- telethon_generator/parser/tl_object.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telethon_generator/parser/tl_object.py b/telethon_generator/parser/tl_object.py index c096a233..fdcf5450 100755 --- a/telethon_generator/parser/tl_object.py +++ b/telethon_generator/parser/tl_object.py @@ -165,7 +165,9 @@ class TLArg: # The name may contain "date" in it, if this is the case and the type is "int", # we can safely assume that this should be treated as a "date" object. # Note that this is not a valid Telegram object, but it's easier to work with - if re.search(r'(\b|_)date\b', name) and self.type == 'int': + if self.type == 'int' and ( + re.search(r'(\b|_)date\b', name) or + name in ('expires', 'expires_at', 'was_online')): self.type = 'date' self.generic_definition = generic_definition