Skip to content

Instantly share code, notes, and snippets.

@onilton
Last active March 31, 2017 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onilton/57014770a78d52048c55d00a838af603 to your computer and use it in GitHub Desktop.
Save onilton/57014770a78d52048c55d00a838af603 to your computer and use it in GitHub Desktop.
PythonRocksBot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# sudo pip install python-telegram-bot
# http://t.me/PythonRocksBot
from telegram.ext import Updater, MessageHandler, Filters
answers = {
'python': 'python é massa! Chuck Norris aprova!',
'java': 'buuuuu',
'javascript': 'meu deus...',
'nodejs': 'você achava que javascript era ruim',
'php': 'sem comentários'
}
def answer(bot, update):
update.message.reply_text(answers[update.message.text])
updater = Updater("SUA KEY AQUI")
updater.dispatcher.add_handler(MessageHandler(Filters.text, answer))
updater.start_polling()
updater.idle()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment