Last active
March 31, 2017 14:38
-
-
Save onilton/57014770a78d52048c55d00a838af603 to your computer and use it in GitHub Desktop.
PythonRocksBot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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