mirror of
https://github.com/arkorty/B.Tech-Project-III.git
synced 2026-04-19 12:41:48 +00:00
init
This commit is contained in:
19
negot8/test/test_telegram.py
Normal file
19
negot8/test/test_telegram.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# test_telegram.py (run standalone)
|
||||
import asyncio
|
||||
import sys
|
||||
from telegram import Update
|
||||
from telegram.ext import Application, CommandHandler, ContextTypes
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'backend'))
|
||||
|
||||
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
await update.message.reply_text("🤖 negoT8 Bot A is alive!")
|
||||
|
||||
app = Application.builder().token(os.getenv("TELEGRAM_BOT_TOKEN_A")).build()
|
||||
app.add_handler(CommandHandler("start", start))
|
||||
|
||||
print("Bot A running... Press Ctrl+C to stop")
|
||||
app.run_polling()
|
||||
Reference in New Issue
Block a user