mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 14:04:51 +00:00
Don't decode inline buttons callback data
Clients are able to set any value as plain bytes, this means UTF-8 decoding could fail.
This commit is contained in:
parent
30c0086fde
commit
af937152a1
1 changed files with 2 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ class InlineKeyboardButton(Object):
|
|||
text (``str``):
|
||||
Label text on the button.
|
||||
|
||||
callback_data (``str``, *optional*):
|
||||
callback_data (``bytes``, *optional*):
|
||||
Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes.
|
||||
|
||||
url (``str``, *optional*):
|
||||
|
|
@ -85,7 +85,7 @@ class InlineKeyboardButton(Object):
|
|||
if isinstance(b, KeyboardButtonCallback):
|
||||
return InlineKeyboardButton(
|
||||
text=b.text,
|
||||
callback_data=b.data.decode()
|
||||
callback_data=b.data
|
||||
)
|
||||
|
||||
if isinstance(b, KeyboardButtonSwitchInline):
|
||||
|
|
|
|||
Loading…
Reference in a new issue