Created
October 15, 2019 16:20
-
-
Save ricardotenv/8208cc19a886a1e861580cb58117b039 to your computer and use it in GitHub Desktop.
@lovepython01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
import telepot | |
from telepot.loop import MessageLoop | |
def handle(msg): | |
if msg["text"] == '/ban': | |
bot.kickChatMember(msg["chat"]["id"], msg["reply_to_message"]["from"]["id"]) | |
bot = telepot.Bot(TOKEN) | |
MessageLoop(bot, handle).run_as_thread() | |
print('Listening ...') | |
while 1: | |
time.sleep(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment