X
X
XWR2021-10-14 13:46:54
Python
XWR, 2021-10-14 13:46:54

Inline button for only 1 user?

Hello everyone, tell me how to make an inline button on the library for only 1 person?

The code:

@dp.message_handler(commands=['vip'], commands_prefix='!./')
async def vip_cmd(message):
  vip_menu = InlineKeyboardMarkup()
  vip_kb = InlineKeyboardButton(text = ' Команды', callback_data = 'vip_kb')
  vip_menu.add(vip_check_kb)
  await message.answer(' VIP панель ', reply_markup=vip_menu)

@dp.callback_query_handler(text='vip_kb')
async def handle_cdel_button(c: types.CallbackQuery):
   print(' тут выведит айди для кого кнопка')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
InternetMaster, 2021-10-14
@InternetMaster

For just one? Then, you should write its user_id directly into the Python code, and then check if the user_id of the user matches the user_id in Python

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question