Answer the question
In order to leave comments, you need to log in
How to make a function to forward a message from one user to another in vk_api?
I need the bot to forward the messages of this user with the content of his screenshot to another user at a certain stage of the dialogue with one user.
That is, the user, in response to the bot's question, must send the bot a screenshot, and the bot must forward this message with the screenshot to another user.
At the moment, this part of the code looks like this:
def step2():
msg = responses_session.get('step2') # предыдущий ответ пользователя со скриншотом
global screenshot
screenshot = True
global ytAttach
ytAttach = event.attachments
u = vk.users.get(user_ids=[str(event.user_id)])
vk.messages.send(
random_id=randomGen(1, 9999),
user_id=event.user_id,
message=msg
)
print(msgSent(event.user_id, randId, msg))
vk.messages.send(
forward={
'owner_id': event.user_id,
'peer_id': event.peer_id,
'message_ids': event.message_id,
# 'conversation_message_ids': event.message_id,
},
random_id=randomGen(1, 9999),
user_id=224453696,
message=partnerRequest(ytLink, event.user_id, u[0]['first_name'], u[0]['last_name']),
attachment=ytAttach,
keyboard=json.dumps(keyboard_yes_no, ensure_ascii=False)
)
Answer the question
In order to leave comments, you need to log in
Found a solution to my problem. I really don't know how reliable it is.
Should have used forward_messages=event.message_id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question