File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1+ import os
12from telegram import Update
23from telegram .ext import ApplicationBuilder , CommandHandler , ContextTypes
34from openpyxl import load_workbook
45
6+ TELEGRAM_BOT_TOKEN = os .getenv ("TELEGRAM_BOT_TOKEN" )
7+ XLSX_FILE_PATH = os .getenv ("XLSX_FILE_PATH" )
8+
59async def find (update : Update , context : ContextTypes .DEFAULT_TYPE ) -> None :
610 if update .message and update .message .text :
7- workbook = load_workbook ('test.xlsx' )
11+ workbook = load_workbook (XLSX_FILE_PATH )
812 sheet = workbook .active
913 response_message = ''
1014
@@ -19,7 +23,7 @@ async def find(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
1923
2024def main ():
2125 try :
22- app = ApplicationBuilder ().token ("BOT_TOKEN" ).build ()
26+ app = ApplicationBuilder ().token (TELEGRAM_BOT_TOKEN ).build ()
2327 app .add_handler (CommandHandler ("find" , find ))
2428 app .run_polling ()
2529 except Exception as err :
You can’t perform that action at this time.
0 commit comments