Fixed bug concerning wrong identifier in callback queries
If 'from' in update do not consider update['message']
This commit is contained in:
parent
b19e7734e0
commit
d6b7b3002e
@ -1481,6 +1481,12 @@ class Bot(TelegramBot, ObjectWithDatabase):
|
|||||||
assert identifier is not None, (
|
assert identifier is not None, (
|
||||||
"Provide a user_id or update object to get a user identifier."
|
"Provide a user_id or update object to get a user identifier."
|
||||||
)
|
)
|
||||||
|
if (
|
||||||
|
isinstance(identifier, dict)
|
||||||
|
and 'message' in identifier
|
||||||
|
and 'from' not in identifier
|
||||||
|
):
|
||||||
|
identifier = identifier['message']
|
||||||
if isinstance(identifier, dict) and 'from' in identifier:
|
if isinstance(identifier, dict) and 'from' in identifier:
|
||||||
identifier = identifier['from']['id']
|
identifier = identifier['from']['id']
|
||||||
assert type(identifier) is int, (
|
assert type(identifier) is int, (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user