A
A
Alnur122020-10-14 16:51:17
In contact with
Alnur12, 2020-10-14 16:51:17

How to find message id for forward_messages?

How to find the message id for forward_messages ?

# coding: utf-8
import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
from vk_api.utils import get_random_id
def write_message(sender, message):
    authorize.method('messages.send', {'peer_id':sender, 'message': message, 'random_id' : get_random_id(), 'forward_messages' = event.id})
token = "SECRET"
authorize = vk_api.VkApi(token = token)
longpoll = VkLongPoll(authorize)
for event in longpoll.listen():
    if event.type == VkEventType.MESSAGE_NEW and event.text:
        reseived_message = event.text 
        sender = event.peer_id
        if reseived_message == "Альнур":
            write_message(sender, "Бот в разработке. Поэтому я не могу делать оповещения.\nЭтот [all.alll.alll|еблан] не до конца сделал меня.")
            
        if reseived_message == "бот":
            write_message(sender, "Лучше пиши слово Альнур")

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question