Answer the question
In order to leave comments, you need to log in
How to delete a message in a Vk conversation using vk.api?
response to this code
cmd.on(/^(?:test)$/i, async (message, bot) => {
console.log(message)
})
MessageContext {
id: 0,
conversationMessageId: 132192,
peerId: 2000000001 ,
peerType: 'chat',
senderId: 502634070,
senderType: 'user',
createdAt: 1589127297,
text: 'test',
forwards: MessageForwardsCollection(0) [],
attachments: [],
isOutbox: false,
type: 'message' ,
subTypes: [
'new_message'
],
state: {}
}
How I tried to make the bot delete the message
cmd.on(/^(?:test)$/i, async (message, bot) =>{
vk.api.messages.delete({
message_ids: message.conversationMessageId,
delete_for_all: 1
})
message.send(`message deleted`)
})
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