I want to add payment for my telegram bot(pyTelegramBotAPI).
But when I use payments_example.py from GitHub - it gives exception:
AttributeError: 'LabeledPrice' object has no attribute 'to_dict'.
Can somebody help me with this?
shipping_options = [
ShippingOption(id='instant', title='WorldWide Teleporter').add_price(LabeledPrice('Teleporter', 1000))
]
@bot.shipping_query_handler(func=lambda query: True)
def shipping(shipping_query):
print(shipping_query)
bot.answer_shipping_query(
shipping_query.id,
ok=True,
shipping_options=shipping_options,
error_message='Oh, seems like our Dog couriers are having a lunch right now. Try again later!'
)