import vk_api from vk_api.longpoll import VkLongPoll, VkEventType token = "eae979f39b9fb10730d5af1fdb6132d04306a8dcd618b81cee5700ed646d1c531e6b12360410f0754880a" def write(message): try: vk.method('messages.send', {"random_id": "0", 'chat_id': event.chat_id, 'message': message}) except: pass vk = vk_api.VkApi(token=token) been = False print("Запущен!") for event in VkLongPoll(vk).listen(): if event.type == VkEventType.MESSAGE_NEW: text = event.text.lower() for i in ("макс", "фомин", "фокмин", "фомкин", "фокин"): if i in text: been = True if been: write("м?") been = False
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question