Answer the question
In order to leave comments, you need to log in
How to resolve KeyError: 'reply_message' error?
Hello, I'm getting a KeyError when I try to enter a command without specifying a forwarded message.
Specifically, from this command, I get the id of the user whose messages I or someone else marked.
if msg == "%айди":
x = session_api.messages.getById(message_ids=event.message_id)
reply = x["items"][0]["reply_message"]
send_message(peer_id=event.peer_id,message="Айди - " + str(reply["from_id"]))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question