Payment.py - change from_id to sender_id

This commit is contained in:
apepenkov 2020-10-03 19:38:39 +03:00 committed by GitHub
parent 3e188d0344
commit 37834c9ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,9 +85,9 @@ async def payment_received_handler(event):
payment: types.MessageActionPaymentSentMe = event.message.action
# do something after payment was recieved
if payment.payload.decode('UTF-8') == 'product A':
await bot.send_message(event.message.from_id, 'Thank you for buying product A!')
await bot.send_message(event.message.sender_id, 'Thank you for buying product A!')
elif payment.payload.decode('UTF-8') == 'product B':
await bot.send_message(event.message.from_id, 'Thank you for buying product B!')
await bot.send_message(event.message.sender_id, 'Thank you for buying product B!')
raise events.StopPropagation