Код:
@bot.callback_query_handler(lambda c: c.data == "aim_confirm")
def aim_confirm(update, c):
global numbers
userID = c.from_user.id # ID пользователя
chatID = c.message.chat.id # ID чата с пользователем
query = update.callback_query
try:
if numbers != []:
amount = int(''.join(map(str, numbers)))
numbers = []
db.changeaim(userID, amount)
bot.edit_message_text('*Успешно*', c.message.chat.id, c.message.id,
parse_mode='Markdown',
reply_markup=InlineKeyboardMarkup(ib.back))
else:
bot.answer_callback_query(callback_query_id=query.id, text = 'Введите число!', show_alert=True)
except Error as err:
print(err)
Ошибка:
Traceback (most recent call last):
File "C:\Users\sasha\Desktop\проекты\финансист (открыто)\код2.0\bot.py", line 330, in <module>
bot.polling()
File "C:\Users\sasha\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\__init__.py", line 619, in polling
self.__threaded_polling(none_stop, interval, timeout, long_polling_timeout, allowed_updates)
File "C:\Users\sasha\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\__init__.py", line 678, in __threaded_polling
raise e
File "C:\Users\sasha\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\__init__.py", line 641, in __threaded_polling
self.worker_pool.raise_exceptions()
File "C:\Users\sasha\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\util.py", line 130, in raise_exceptions
raise self.exception_info
File "C:\Users\sasha\AppData\Local\Programs\Python\Python39\lib\site-packages\telebot\util.py", line 82, in run
task(*args, **kwargs)
TypeError: aim_confirm() missing 1 required positional argument: 'c'