Skip to content

Instantly share code, notes, and snippets.

@Highstaker
Created August 25, 2016 04:45
Show Gist options
  • Save Highstaker/af2a9e740431a29719541b7e56a60ef4 to your computer and use it in GitHub Desktop.
Save Highstaker/af2a9e740431a29719541b7e56a60ef4 to your computer and use it in GitHub Desktop.
A simple bot working on webhooks.
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
def msg_process(bot, update):
bot.sendMessage(131711493,update.message.text + " hello")
updater = Updater("176032236:AAF6h2YjwtUfsLP5K5O5wD8xV2dg3VadL5k")
disp = updater.dispatcher
updater.start_webhook(listen='0.0.0.0',
port=8443,
url_path='176032236:AAF6h2YjwtUfsLP5K5O5wD8xV2dg3VadL5k',
key='/tmp/private.key',
cert='/tmp/cert.pem',
webhook_url='https://185.70.187.235:8443/176032236:AAF6h2YjwtUfsLP5K5O5wD8xV2dg3VadL5k')
disp.add_handler(MessageHandler([Filters.text], msg_process))
updater.idle()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment