adding bot.py for bot logic

This commit is contained in:
Hosein
2025-12-23 14:05:57 +03:30
parent 876c6d625a
commit df3d1d64fb
2 changed files with 29 additions and 319 deletions
+17
View File
@@ -0,0 +1,17 @@
import os
_bot = None
def get_bot():
global _bot
if _bot is None:
import telebot
BOT_TOKEN = os.environ.get("BOT_TOKEN")
_bot = telebot.TeleBot(BOT_TOKEN)
# Register handlers
@_bot.message_handler(commands=["start"])
def start(message):
_bot.reply_to(message, "Welcome!")
return _bot