unpinChatMessage

Description

Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.

Arguments

Name Type Description
chat_id Union[int, str] Unique identifier for the target chat or username of the target channel (in the format @channelusername)

Response

Type: bool

Description: Returns True on success.

Usage

As bot method

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

Method as object

Imports:

  • from aiogram.methods import UnpinChatMessage
  • from aiogram.api.methods import UnpinChatMessage
  • from aiogram.api.methods.unpin_chat_message import UnpinChatMessage

In handlers with current bot

result: bool = await UnpinChatMessage(...)

With specific bot

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

As reply into Webhook in handler

return UnpinChatMessage(...)