editMessageWidgetData

Returns: bool

class aiogram.methods.edit_message_widget_data.EditMessageWidgetData(*, chat_id: int | str | None = None, message_id: int | None = None, inline_message_id: str | None = None, public_data: str | None = None, chat_data: str | None = None, **extra_data: Any)[source]

Use this method to 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. On success, True is returned.

Source: https://core.telegram.org/bots/api#editmessagewidgetdata

chat_id: int | str | None

Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target supergroup in the format @username

message_id: int | None

Required if inline_message_id is not specified. Identifier of the message with the widget

inline_message_id: str | None

Required if chat_id and message_id are not specified. Identifier of the inline message

public_data: str | None

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 | None

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

Usage

As bot method

result: bool = await bot.edit_message_widget_data(...)

Method as object

Imports:

  • from aiogram.methods.edit_message_widget_data import EditMessageWidgetData

  • alias: from aiogram.methods import EditMessageWidgetData

With specific bot

result: bool = await bot(EditMessageWidgetData(...))

As reply into Webhook in handler

return EditMessageWidgetData(...)