@db.callback_query_handler(tovarycb.filter())
async def tow(callback: types.CallbackQuery, callback_data: dict):
b = cur.execute('SELECT * FROM tovary').fetchall()
for a in b:
if callback_data['action'] == a[0]:
b = cur.execute(f'SELECT sum FROM tovary WHERE name == ?', [callback_data['action']]).fetchone()
if b:
await bot.delete_message(callback.from_user.id, callback.message.message_id)
return await bot.send_message(callback.from_user.id, f" Товар: {callback_data['action']}\n Цена: {b[0]}")
break
С этой кнопки мне надо передать b[0] во 2 кнопку