def handle_delete_item(call): bot.edit_message_text("Выберите товар для удаления", call.message.chat.id, call.message.message_id) bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id, reply_markup=markups.delete_item( call.message.chat.id))
def handle_delete_from_db(call): db = sqlite3.connect("clientbase.db") cur = db.cursor() cur.execute("DELETE FROM items WHERE id = ?", (str(call.data[1:]))) db.commit() bot.edit_message_reply_markup(call.message.chat.id, call.message.message_id, reply_markup=markups.delete_item(call.message.chat.id)) print('deleted')