· 5 years ago · Dec 23, 2020, 05:54 AM
1import telepot
2from pprint import pprint
3import time
4from telepot.loop import MessageLoop
5
6key = "API Key"
7
8bot = telepot.Bot(key)
9
10def handle(msg):
11 pprint(msg)
12
13bot.message_loop(handle)
14
15while 1:
16 time.sleep(10)