#
#
#yamynginx2020-02-21 03:37:17
PHP
#yamynginx, 2020-02-21 03:37:17

How do I forward a message to a conversation?

Hello.
I wrote a chat bot for VK on the Callback API, added it to the conversation, messages are sent to the server.
Here I write means in the conversation "hello", what the bot should trigger and write something.
Here is the structure:

{
    "type": "message_new",
    "object": {
        "message": {
            "date": 1582245097,
            "from_id": 1,
            "id": 0,
            "out": 0,
            "peer_id": 2000000001,
            "text": "привет",
            "conversation_message_id": 107,
            "fwd_messages": [],
            "important": false,
            "random_id": 0,
            "attachments": [],
            "is_hidden": false
        },
        "client_info": {
            "button_actions": [
                "text",
                "vkpay",
                "open_app",
                "location",
                "open_link"
            ],
            "keyboard": true,
            "inline_keyboard": true,
            "lang_id": 0
        }
    },
    "group_id": 1,
    "event_id": "1"
}

I read about messages.getByConversationMessageId , then I call messages.getByConversationMessageId : https://api.vk.com/method/messages.getByConversati...
And in response I get a beep:
{"response":{"count":0,"items":[]}}
What, actually, should I do? I am the creator of the conversation, I even gave the admin panel to the bot, but I get an empty array. Tried to specify and group_id - zero sense.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nokimaro, 2020-02-21
@muxui

Use messages.send and the forward_messages parameter which can be used to set forwarded messages
https://vk.com/dev/messages.send

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question