Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
teleexit/callbackQuery/new.py

16 lines
927 B
Python

from telegram import Update, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import CallbackContext
from main import database
def new(update: Update, context: CallbackContext):
if update['_effective_user']['id'] not in database or not all(database[update['_effective_user']['id']].values()):
context.bot.send_message(chat_id=update.effective_chat.id, text="You have no data saved !",
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Set data",
callback_data="data")],
[InlineKeyboardButton("Home", callback_data="home")]
]))
else:
context.bot.send_message(chat_id=update.effective_chat.id, text="Select your reasons")