Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time, telepot, requests
- TOKEN = '680414411:AAEuHZ8tp5nhc6OIrj10kbhjAS8m6lXHAvY' # amarildo
- # TOKEN = '461853924:AAHYQa4IoXm09pWCMkc3ceCOvLzYAboCG5o' # cleber
- users_spy = ['541457245', '321374553']
- def handle(msg):
- content_type, chat_type, chat_id = telepot.glance(msg)
- print(msg)
- if content_type == 'text' and str(msg['from']['id']) in users_spy:
- '''r = requests.post('https://hooks.slack.com/services/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', json={
- "attachments": [
- {
- "color": "#36a64f",
- "author_name": msg['chat']['title'],
- "pretext": msg['from']['first_name'] + ' ' + msg['from']['last_name'],
- "text": msg['text'],
- "ts": msg['date']
- }
- ]
- })'''
- bot = telepot.Bot(TOKEN)
- bot.message_loop(handle)
- print('Listening...')
- while 1:
- time.sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement