Add boilerplate
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -129,3 +129,4 @@ dmypy.json
 | 
			
		||||
# Pyre type checker
 | 
			
		||||
.pyre/
 | 
			
		||||
 | 
			
		||||
config.py
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										21
									
								
								bot.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								bot.py
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										1
									
								
								sample.config.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
TOKEN = "XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
 | 
			
		||||
		Reference in New Issue
	
	Block a user