From 061a84bef2aed1ed95ac512ee8140ed8a99762ae Mon Sep 17 00:00:00 2001 From: yumupdate <82159969+yumupdate@users.noreply.github.com> Date: Thu, 22 Dec 2022 15:42:30 +0300 Subject: [PATCH] Fix payment.py example (#4005) --- telethon_examples/payment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon_examples/payment.py b/telethon_examples/payment.py index 22358a6a4..c73afbca1 100644 --- a/telethon_examples/payment.py +++ b/telethon_examples/payment.py @@ -85,9 +85,9 @@ async def payment_received_handler(event): payment: types.MessageActionPaymentSentMe = event.message.action # do something after payment was received 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.peer_id.user_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.peer_id.user_id, 'Thank you for buying product B!') raise events.StopPropagation