A
A
Andrey Gilgenberg2021-07-29 23:32:25
Python
Andrey Gilgenberg, 2021-07-29 23:32:25

An error in the code, I can not understand what is wrong?

My code:

elif message.text in[delo.text for delo in user.buisnes]:
    text = {message.text}
    deluga = types.InlineKeyboardMarkup(row_width=2)
    deluga.add(types.InlineKeyboardMarkup(text='Выполннить', callback_data='completed_'))
    deluga.add(types.InlineKeyboardMarkup(text='Удалить', callback_data='delete_'))
    deluga.add(types.InlineKeyboardMarkup(text='Меню', callback_data='menu'))
    bot.send_message(message.chat.id, text, reply_markup=deluga)


Error:
deluga.add(types.InlineKeyboardMarkup(text='Run', callback_data='completed_'))
TypeError: __init__() got an unexpected keyword argument 'text'

on the one hand it points to a line where there is no variable text swears at her with durga, I started programming a week ago, I can’t understand what the trouble is

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stefan, 2021-07-29
@kkid404

deluga.add(types. InlineKeyboardButton(text='Выполннить', callback_data='completed_'))

Replace in adding buttons InlineKeyboardMarkupwithInlineKeyboardButton

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question