vk_session = vk_api.VkApi(token='your_group_token')
vk = vk_session.get_api()
vk.messages.getConversationMembers(peer_id=event.obj.peer_id)
import time
import vk_api
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
def main():
vk_session = vk_api.VkApi(token='Токен группы')
longpoll = VkBotLongPoll(vk_session, 'ID группы')
vk = vk_session.get_api()
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
if 'привет' in event.obj.text.lower():
vk.messages.send(random_id=time.time(), peer_id=event.obj.peer_id, message='И тебе привет мой друг!')
if __name__ == "__main__":
main()
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
vk.messages.send(random_id=time.time(), peer_id=event.obj.peer_id, message='текст')