Answer the question
In order to leave comments, you need to log in
How to use post_id in vk_api?
I decided to write a bot that will send a newly appeared post to the conference in which it is a member, but for some reason the code below does not work and returns the error "[10] internal server error", although the error points to the server, that's all for me It still looks like I screwed up.
for event in longpoll.listen():
if event.type == VkBotEventType.WALL_POST_NEW:
vk.messages.send(chat_id = 1, random_id = random.getrandbits(64),
message = 'Новый пост в сообществе: ',
attachment = event.obj.post_id)
Answer the question
In order to leave comments, you need to log in
attachment should look like this: wall<owner_id>_<post_id>
where owner_id is the community ID
how to make the bot send this message to all conversations in which it is a member?you can try incrementing the chat_id until you get an error saying the conversation doesn't exist
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question