D
D
d3m0l2021-10-23 16:19:13
Python
d3m0l, 2021-10-23 16:19:13

Why TypeError?

I'm doing a wedding in a bot through buttons, I need to check if the ID of the person who called the button matches the ID of the person who clicked on it, and so ... Error.
The code:

@bot.callback_query_handler(func=lambda call: True)
def callback_marry_y(call, message: types.Message):
    if call.message:
        if call.data == f'button_marry_y.{message.from_user.id}':
            if call.from_user.id == message.from_user.id:
                print('da')
            else:
                print('net')


Mistake:
TypeError: callback_marry_y() missing 1 required positional argument: 'message'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2021-10-23
@karabanov

So translate the error from English, because the reason for callback_marry_y is missing 1 required positional argument: 'message'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question