Answer the question
In order to leave comments, you need to log in
Telegram bot sends purchase messages to only one user. How to decide?
When a user (other than the creator) sends a request to purchase a product (he gave an example of one of the products in the cycle (53z)), this invoice does not go to correspondence with the user, but to correspondence with the creator (i.e. me)
<b>
elif call.data == 'punkt3':
keyboard1h = InlineKeyboardMarkup(row_width=2)
key_30r_kurs = InlineKeyboardButton(
text='name',
callback_data='53z')
keyboard1h.add(key_30r_kurs)
elif call.data == '53z':
bot.send_invoice(message.chat.id, #сам инвойс
title='name',
description=' ',
provider_token=provider_token,
currency='rub',
photo_url='',
photo_height=512, # !=0/None or picture won't be shown
photo_width=512,
photo_size=512,
is_flexible=False,
prices=[LabeledPrice('name', 299000)],
start_parameter='service',
invoice_payload='payment')
@bot.pre_checkout_query_handler(func=lambda query: True)
def checkout(pre_checkout_query):
bot.answer_pre_checkout_query(pre_checkout_query.id, ok=True,
error_message="Оплата не прошла - попробуйте, пожалуйста, еще раз,")
@bot.message_handler(content_types=['successful_payment'])
def got_payment(message):
bot.send_message(message.chat.id,
'Ваш заказ был успешным!''Будем рады снова Вас увидеть в нашем телеграм-боте!',
parse_mode='Markdown')
bot.infinity_polling(skip_pending = True)
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