Skip to content

Instantly share code, notes, and snippets.

@andreafortuna andreafortuna/ Secret
Last active Nov 23, 2017

What would you like to do?
ECHO Bot exampli for Telegram and
import requests
import json
import pprint
import logging
import microcule
def app(environ, start_response):
bottoken = 'YOUR_BOT_TOKEN'
baseURL = ''
data = json.loads(json.dumps(Hook['params']))
chat_id = data['message']['chat']['id']
message = data['message']['text']
data = { "chat_id" : chat_id, "text" : message }
sendURL = baseURL + bottoken + "/sendMessage"
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}, data=json.dumps(data), headers=headers, verify=False)
start_response('200 OK', [('content-type', 'text/plain')])
return '\n'
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.