added authentication to the bot. added bot commnads. added create button for when the db is empty or no data is available to show.

This commit is contained in:
Hosein
2026-01-05 23:40:13 +03:30
parent 4b5b24c97c
commit caac6c3a08
18 changed files with 369 additions and 47 deletions
+4 -3
View File
@@ -7,6 +7,7 @@ load_dotenv()
BOT_TOKEN = os.environ.get("BOT_TOKEN")
def ensure_no_webhook():
"""Remove webhook before starting polling"""
response = requests.post(
@@ -15,13 +16,13 @@ def ensure_no_webhook():
if response.json()['ok']:
print("✅ Webhook removed, starting polling...")
return True
print("⚠️ Warning: Could not remove webhook")
return False
if __name__ == "__main__":
if ensure_no_webhook():
bot = get_bot()
print("🤖 Bot is polling locally...")
bot.polling(non_stop=True)
bot.polling(non_stop=True)