Add boilerplate

This commit is contained in:
Ceda EI 2021-01-11 19:14:54 +05:30
parent 6ad6408b57
commit 10317b2dd1
3 changed files with 23 additions and 0 deletions

1
.gitignore vendored
View File

@ -129,3 +129,4 @@ dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
config.py

21
bot.py Normal file
View File

@ -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()

1
sample.config.py Normal file
View File

@ -0,0 +1 @@
TOKEN = "XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"