Skip to content

Instantly share code, notes, and snippets.

@ricardotenv
Created October 15, 2019 16:20
Show Gist options
  • Save ricardotenv/8208cc19a886a1e861580cb58117b039 to your computer and use it in GitHub Desktop.
Save ricardotenv/8208cc19a886a1e861580cb58117b039 to your computer and use it in GitHub Desktop.
@lovepython01
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