Advertisement
Olegos

Untitled

Aug 26th, 2020
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import vk_api
  3. from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
  4.  
  5.  
  6. vk_session = vk_api.VkApi(token='')
  7. call = vk_session.get_api()
  8. longpoll = VkBotLongPoll(vk_session, '')
  9.  
  10. def echo(text=None, sticker=None, disable_mentions=0, dont_parse_links=0):
  11. return call.messages.send(
  12. peer_id=event.obj.message['peer_id'],
  13. message=text,
  14. sticker_id=sticker,
  15. dont_parse_links=dont_parse_links,
  16. disable_mentions=disable_mentions,
  17. random_id=0)
  18.  
  19.  
  20. for event in longpoll.listen():
  21.  
  22. if event.type == VkBotEventType.MESSAGE_NEW:
  23. print(echo(f'Cообщение до'))
  24. call.messages.edit(
  25. peer_id=event.obj.message['peer_id'],
  26. message='Сообщение прсое',
  27. conversation_message_id=event.obj.message['reply_message']['conversation_message_id'],
  28. random_id=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement