diff --git a/requirements.txt b/requirements.txt index 6a97db0..83e62ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ django>=2 cherrypy paste git+https://github.com/natevw/django-sameas.git@master#egg=django-sameas +Pygments diff --git a/website/static/website/example.py b/website/static/website/example.py index 954951d..3a6fdbf 100644 --- a/website/static/website/example.py +++ b/website/static/website/example.py @@ -1,15 +1,13 @@ from telegram.ext import Updater, CommandHandler -def start(bot, update): - update.message.reply_text('Hello World!') -def hello(bot, update): +def hello(update, context): update.message.reply_text( 'Hello {}'.format(update.message.from_user.first_name)) -updater = Updater('YOUR TOKEN HERE') -updater.dispatcher.add_handler(CommandHandler('start', start)) +updater = Updater('YOUR TOKEN HERE', use_context=True) + updater.dispatcher.add_handler(CommandHandler('hello', hello)) updater.start_polling() diff --git a/website/templates/website/index.html b/website/templates/website/index.html index c43247c..31f4509 100644 --- a/website/templates/website/index.html +++ b/website/templates/website/index.html @@ -14,12 +14,12 @@

It's fun

from telegram.ext import Updater, CommandHandler
 
 
-def hello(bot, update):
-    update.message.reply_text(
-        'Hello {}'.format(update.message.from_user.first_name))
+def hello(update, context):
+    update.message.reply_text(
+        'Hello {}'.format(update.message.from_user.first_name))
 
 
-updater = Updater('YOUR TOKEN HERE')
+updater = Updater('YOUR TOKEN HERE', use_context=True)
 
 updater.dispatcher.add_handler(CommandHandler('hello', hello))