Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import time
- import telepot
- import mysql
- def handle(msg):
- content_type, chat_type, chat_id = telepot.glance(msg)
- print(content_type, chat_type, chat_id)
- if content_type == 'text':
- bot.sendMessage(chat_id, msg['text'])
- #TOKEN = sys.argv[1] # get token from command-line
- TOKEN = '305321080:AAHQTqiX6ok4kR2HEMdlejOJ_Cp5NZqpYUA'
- bot = telepot.Bot(TOKEN)
- bot.message_loop(handle)
- print ('Listening ...')
- # Keep the program running.
- while 1:
- time.sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement