How to use post_id in vk_api?

Decided to write a bot that will send to the conference, in which he is, that only appeared post, but below mentioned code doesn't work and returns an error "[10] internal server error" though the error points to the server, I still think that I messed up.
for event in add.listen():
 if event.type == VkBotEventType.WALL_POST_NEW:
 vk.messages.send(chat_id = 1, random_id = random.getrandbits(64),
 message = 'a New post in the community: ',
 attachment = event.obj.post_id)

In addition to this issue, I would like to know how to make a bot sent this message to all conversations that consist of?
March 25th 20 at 13:46
1 answer
March 25th 20 at 13:48
attachment should be like this: wall<owner_id>_<post_id>, where the owner_id is the ID community

how to make a bot sent this message to all conversations that consist of?
you can try to increase chat_id until you get an error stating the non-existence of the conversation
The point is that the post_id returns nothing, even if you use print(event.obj.post_id) in the console will output None - kaley.Batz commented on March 25th 20 at 13:51
@kaley.Batz, because event.obj — the object to write on the wallthat does not have a post_id field, but there is just id - Adalberto commented on March 25th 20 at 13:54
@Adalberto, thank you, they say that chats can be done by pushing a chat_id, then how to catch the exception? Because the bot is closed and the try except in this case it does not work - kaley.Batz commented on March 25th 20 at 13:57
@kaley.Batz, I checked, VC returns error internal server error, see the documentation for your library, how to handle errors - Adalberto commented on March 25th 20 at 14:00

Find more questions by tags VKontakteAPIPython