P
P
pivazik2020-06-05 21:01:11
Python
pivazik, 2020-06-05 21:01:11

How to get user id from reply_message?

Hello, I used to work with a page bot and there were no problems with reply_message. Now I switched to a bot for the group and I had a problem with it.
On the page bot, the script was like this:

x = vk.messages.getById(message_ids=event.message_id)
reply = x["items"][0]["reply_message"]

I decided to remake it for a more suitable one:
get_id = vk.method("messages.getById", {"message_ids": event.message_id})
reply = get_id["items"][0]["reply_message"]

But as it turned out when checking, there is no message_id in VkBotMessageEvent, and it gives an error to the console. The question arises - what to put in place of event.message_id?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WolfInChains, 2020-06-05
@pivazik

"user_id": event.obj.reply_message['from_id']

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question