Answer the question
In order to leave comments, you need to log in
How to make the bot repost new posts from the VK group?
At the moment I am writing my "Chat Manager" for a conversation and a group in general, I need help with reposts in a conversation.
I found the code on another forum, but it does not do what I would like.
if event_chat.type == VkBotEventType.WALL_POST_NEW:
id_ = event_chat.object['id']
owner_id_ = event_chat.group_id
wall_id = f'wall-{owner_id_}_{id_}'
write_chat(id2,'vk.com/botcoled?w={}'.format(wall_id))
Answer the question
In order to leave comments, you need to log in
You need to call the method messages.send
, passing a parameter attachment
with a value in the form of the necessary attachments in the format <type><owner_id>_<media_id>
separated by commas.
I don’t know what is in the write_chat function and I won’t guess, therefore
if event_chat.type == VkBotEventType.WALL_POST_NEW:
id_ = event_chat.object['id']
owner_id_ = event_chat.group_id
wall_post = f'wall-{owner_id_}_{id_}'
vk.method('messages.send', {'peer_id': id2, 'message': 'Новый пост в группе', 'attachment': wall_post})
_
after owner_id
that you can not put
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question