Closed hammersharkfish closed 1 year ago
Incoming message: Message(id=23833, peer_id=PeerUser(user_id=5047380096), date=datetime.datetime(2023, 7, 16, 6, 52, 24, tzinfo=datetime.timezone.utc), message='📌Primary Trade 3%🇸6%', out=False, mentioned=False, media_unread=False, silent=False, post=False, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, noforwards=False, from_id=None, fwd_from=None, via_bot_id=None, reply_to=None, media=None, reply_markup=ReplyInlineMarkup(rows=[KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='Maestro', data=b'maestro', requires_password=False), KeyboardButtonCallback(text='Sniper Bot', data=b'sniper', requires_password=False)]), KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='⬅️', data=b'back', requires_password=False), KeyboardButtonCallback(text='🔃GTAN', data=b'\xf0\x9f\x94\x84', requires_password=False), KeyboardButtonCallback(text='➡️', data=b'forward0', requires_password=False)]), KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='p1', data=b'asdsad', requires_password=False), KeyboardButtonCallback(text='auto', data=b'buy', requires_password=False), KeyboardButtonCallback(text='p2', data=b'sell', requires_password=False)])]), entities=[], views=None, forwards=None, replies=None, edit_date=None, post_author=None, grouped_id=None, reactions=None, restriction_reason=[], ttl_period=None)
^ The message .
The UTF-8 encoded bytes of your emoji string must match exactly with those of the button. This includes any modifiers, visible or not.
You can click by index or find the button doing your own comparisons instead.
Otherwise it would be helpful to have a dump of the messge to learn what the buttons look like. As it stands this issue is not actionable.
Incoming message:
Message(id=23833, peer_id=PeerUser(user_id=5047380096), date=datetime.datetime(2023, 7, 16, 6, 52, 24, tzinfo=datetime.timezone.utc), message='📌Primary Trade 3%🇸6%', out=False, mentioned=False, media_unread=False, silent=False, post=False, from_scheduled=False, legacy=False, edit_hide=False, pinned=False, noforwards=False, from_id=None, fwd_from=None, via_bot_id=None, reply_to=None, media=None, reply_markup=ReplyInlineMarkup(rows=[KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='Maestro', data=b'maestro', requires_password=False), KeyboardButtonCallback(text='Sniper Bot', data=b'sniper', requires_password=False)]), KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='⬅️', data=b'back', requires_password=False), KeyboardButtonCallback(text='🔃GTAN', data=b'\xf0\x9f\x94\x84', requires_password=False), KeyboardButtonCallback(text='➡️', data=b'forward0', requires_password=False)]), KeyboardButtonRow(buttons=[KeyboardButtonCallback(text='p1', data=b'asdsad', requires_password=False), KeyboardButtonCallback(text='auto', data=b'buy', requires_password=False), KeyboardButtonCallback(text='p2', data=b'sell', requires_password=False)])]), entities=[], views=None, forwards=None, replies=None, edit_date=None, post_author=None, grouped_id=None, reactions=None, restriction_reason=[], ttl_period=None)
^ The message .
The message
is here
Right, I had the issue open before you posted that, so I did not see your comment.
The text seem to match.
You could try clicking by b'forward0'
data directly instead.
If the message was edited or the message you're using to click on is wrong, Telegram will complain.
If message.click
still fails even if you use data
directly, but you can get it to work with the raw API method, then there may be something to fix.
Code that causes the issue
Expected behavior
User clicks the button .
Actual behavior
Correctly clicks on button which has the text "auto". Throws error when clicking on inline button having text "➡️" .
Traceback
Telethon version
1.28.5
Python version
3.x
Operating system (including distribution name and version)
windows 10
Other details
No response
Checklist
pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip
and triggered the bug in the latest version.