edit_message_widget_data()

async Client.edit_message_widget_data()

Edit data of a widget in a message sent by the bot or via the bot (for inline bots). Public data of a shared widget can be changed at most once per second.

Usable by Users Bots
Parameters:
  • chat_id (int | str, optional) – Unique identifier (int) or username (str) of the target chat. Required if inline_message_id is not specified.

  • message_id (int, optional) – Identifier of the message with the widget. Required if inline_message_id is not specified.

  • inline_message_id (str, optional) – Identifier of the inline message. Required if chat_id and message_id are not specified.

  • public_data (str, optional) – New public data of the widget, 0-1024 bytes; pass an empty string to remove the public data. If omitted, then the public data isn’t changed.

  • chat_data (str, optional) – New data of the widget, which is specific to the message, 0-1024 bytes; pass an empty string to remove the data. If omitted, then the data isn’t changed.

Returns:

bool – True on success.

Example

await app.edit_message_widget_data(chat_id, message_id, chat_data="new")