Answer the question
In order to leave comments, you need to log in
Telebot How to replace text on photo?
Help friends, there is such a piece of code where I enter the text (Product) and in the case of a purchase (product), the text is sent to the buyer.
It is necessary to replace the text with the photo
That is, I send a photo, and in the case of a purchase, a photo is sent to the buyer
Thank you!
# Accepting product data
@rate_limit(0)
@dp.message_handler(IsAdmin(), state=StorageItems.here_add_items)
async def input_item_data(message: types.Message, state: FSMContext):
delete_msg = await message.answer("<b>⌛ Ждите, товары добавляются...</b>")
count_add = 0
get_all_items = message.text.split("\n\n")
for check_item in get_all_items:
if not check_item.isspace() and check_item != "":
count_add += 1
async with state.proxy() as data:
category_id = data["here_cache_add_item_category_id"]
position_id = data["here_cache_add_item_position_id"]
data["here_count_add_items"] += count_add
add_itemx(category_id, position_id, get_all_items, message.from_user.id,
clear_firstname(message.from_user.first_name))
await bot.delete_message(message.from_user.id, delete_msg.message_id)
await message.answer(f"<b> Товары в кол-ве</b> <u>{count_add}шт</u> <b>были успешно добавлены ✅</b>")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question