mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-06 14:43:13 +03:00
Fix CallbackQuery using string regex
This commit is contained in:
parent
419fe6dca3
commit
a9a2401e44
|
@ -36,7 +36,8 @@ class CallbackQuery(EventBuilder):
|
||||||
self.data = data
|
self.data = data
|
||||||
elif hasattr(data, 'match') and callable(data.match):
|
elif hasattr(data, 'match') and callable(data.match):
|
||||||
if not isinstance(getattr(data, 'pattern', b''), bytes):
|
if not isinstance(getattr(data, 'pattern', b''), bytes):
|
||||||
data = re.compile(data.pattern.encode('utf-8'), data.flags)
|
data = re.compile(data.pattern.encode('utf-8'),
|
||||||
|
data.flags & (~re.UNICODE))
|
||||||
|
|
||||||
self.data = data.match
|
self.data = data.match
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user