C
C
Cry492021-06-21 03:07:34
Python
Cry49, 2021-06-21 03:07:34

Why does the error appear: AttributeError: 'VkBotMessageEvent' object has no attribute 'message_id'?

if from_id in muted:
            vk.messages.delete(
                message_ids=event.message_id,
                chat_id=event.chat_id,
                delete_for_all=1,
            )

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WolfInChains, 2021-06-21
@Cry49

message_ids=event.object.conversation_message_id
For a group, deleting messages occurs through conversation_message_id
Print eventto see what comes in it.

G
gromyko21, 2021-06-21
@gromyko21

The error is message_ids=event.message_id, your event(which is VkBotMessageEvent) has no message_id attribute

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question