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
+10 -10
View File
@@ -1,5 +1,4 @@
from telebot import types
from bot.utils.auth import is_authenticated
# TODO: Add Pagincation to Showing rows of entities (To all entities)
@@ -7,16 +6,17 @@ from bot.utils.auth import is_authenticated
def register(bot):
@bot.message_handler(commands=["start"])
def start_handler(message):
if is_authenticated(message.from_user.id):
bot.send_message(
message.chat.id, "authorized user! Welcome.")
else:
bot.send_message(
message.chat.id, "Welcome! Use buttons to fetch from database.")
startMessage(bot, message=message)
markup = startMarkup()
bot.reply_to(message, "Use buttons to fetch from database.",
reply_markup=markup)
def startMessage(bot, message):
# if is_authenticated(message.from_user.id):
# bot.send_message(
# message.chat.id, "authorized user! Welcome.")
markup = startMarkup()
bot.reply_to(message, "Use buttons to fetch from database.",
reply_markup=markup)
def startMarkup():