Add boilerplate
This commit is contained in:
parent
6ad6408b57
commit
10317b2dd1
|
@ -129,3 +129,4 @@ dmypy.json
|
||||||
# Pyre type checker
|
# Pyre type checker
|
||||||
.pyre/
|
.pyre/
|
||||||
|
|
||||||
|
config.py
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
"Tracking everything bot"
|
||||||
|
import logging
|
||||||
|
from telegram.ext import Updater
|
||||||
|
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||||
|
level=logging.INFO)
|
||||||
|
from telegram.ext import CommandHandler
|
||||||
|
import config
|
||||||
|
|
||||||
|
def start(update, ctx):
|
||||||
|
"/start"
|
||||||
|
ctx.bot.send_message(chat_id=update.effective_chat.id,
|
||||||
|
text=("Welcome to TEB.\n\n/f for food\n/w for workout"
|
||||||
|
"\n/s for studies"))
|
||||||
|
|
||||||
|
updater = Updater(token=config.TOKEN, use_context=True)
|
||||||
|
dispatcher = updater.dispatcher
|
||||||
|
|
||||||
|
start_handler = CommandHandler('start', start)
|
||||||
|
dispatcher.add_handler(start_handler)
|
||||||
|
|
||||||
|
updater.start_polling()
|
|
@ -0,0 +1 @@
|
||||||
|
TOKEN = "XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
Loading…
Reference in New Issue