Answer the question
In order to leave comments, you need to log in
How to receive information about a new message in a conversation?
I want to make such a hat, so that if a conversation participant throws off an attachment in the form of a photo or story, the bot will delete this message and send a message to the conversation like: @id, Hey! What are you doing?
How can such a thing be done?
I understand what is needed: messages.getChat, messages.getByConversationMessageId, messages.deleteChatPhoto
But I don’t understand how to make the bot listen to the conversation, here is my sketch:
def start(self):
while True:
try:
chat_id = vk.messages.searchConversations(q='Тест', count=1)['items'][0]['peer']['local_id']
print(chat_id)
message = 'Привет'
vk.method("messages.send", {"peer_id": 2000000117, "message": message, "conversation_message_ids": 1})
except Exception as ex:
print("Error", ex)
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