Subject | Hash | Author | Date (UTC) |
---|---|---|---|
initial | 2b4b51beb2df4f4380afcc3134c3de8546c9bac6 | Paul van Noort | 2018-11-14 17:59:38 |
File | Lines added | Lines deleted |
---|---|---|
maxxi0n/maxxion_bot.py | 31 | 0 |
maxxi0n/readme.md | 6 | 0 |
File maxxi0n/maxxion_bot.py added (mode: 100755) (index 0000000..02a3dd3) | |||
1 | #!/usr/bin/env python3 | ||
2 | |||
3 | import logging | ||
4 | from telegram.ext import Updater | ||
5 | from telegram.ext import CommandHandler | ||
6 | updater = Updater(token='761031416:AAFFgYNhJAw7mx1dVnUoY_mK04z5_-V1HpY') | ||
7 | |||
8 | dispatcher = updater.dispatcher | ||
9 | logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', | ||
10 | level=logging.INFO) | ||
11 | |||
12 | def start(bot, update): | ||
13 | bot.send_message(chat_id=update.message.chat_id, text="I'm a maxxi0nBot, please do not talk to me!") | ||
14 | |||
15 | def help(bot, update): | ||
16 | bot.send_message(chat_id=update.message.chat_id, text="Ugh, Humans... You can use /start and /help.. And /faq for other dumb questions") | ||
17 | |||
18 | def faq(bot, update): | ||
19 | bot.send_message(chat_id=update.message.chat_id, text="Q: What team should i join? A: Bike Teams, Best Teams") | ||
20 | |||
21 | |||
22 | |||
23 | |||
24 | start_handler = CommandHandler('start', start) | ||
25 | help_handler = CommandHandler('help', help) | ||
26 | faq_handler = CommandHandler('faq', faq) | ||
27 | dispatcher.add_handler(start_handler) | ||
28 | dispatcher.add_handler(help_handler) | ||
29 | dispatcher.add_handler(faq_handler) | ||
30 | updater.start_polling() | ||
31 |
File maxxi0n/readme.md added (mode: 100644) (index 0000000..7fbcd15) | |||
1 | # telegram bot | ||
2 | # pip install python-telegram-bot --upgrade | ||
3 | # | ||
4 | # pip3 install telegram | ||
5 | # api token 761031416:AAFFgYNhJAw7mx1dVnUoY_mK04z5_-V1HpY | ||
6 |