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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user