Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import vk_api
- from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
- vk_session = vk_api.VkApi(token='')
- call = vk_session.get_api()
- longpoll = VkBotLongPoll(vk_session, '')
- def echo(text=None, sticker=None, disable_mentions=0, dont_parse_links=0):
- return call.messages.send(
- peer_id=event.obj.message['peer_id'],
- message=text,
- sticker_id=sticker,
- dont_parse_links=dont_parse_links,
- disable_mentions=disable_mentions,
- random_id=0)
- for event in longpoll.listen():
- if event.type == VkBotEventType.MESSAGE_NEW:
- print(echo(f'Cообщение до'))
- call.messages.edit(
- peer_id=event.obj.message['peer_id'],
- message='Сообщение прсое',
- conversation_message_id=event.obj.message['reply_message']['conversation_message_id'],
- random_id=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement