Updating messages

declineSuggestedPost()

Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success.

parameters

parametertyperequireddescription
chat_idnumberrequiredUnique identifier for the target direct messages chat
message_idnumberrequiredIdentifier of a suggested post message to decline
commentstringoptionalComment for the creator of the suggested post; 0-128 characters

returns

boolean

usage in yaebal

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
import type { DeclineSuggestedPostParams } from "@yaebal/types";

await bot.api.call<boolean>("declineSuggestedPost", {
  chat_id: 123456789,
  message_id: 1,
} satisfies DeclineSuggestedPostParams);

context shortcut

also available as ctx.declineSuggestedPost() on 10 context types — see @yaebal/contexts.

context shortcut
/** Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns *True* on success. */
ctx.declineSuggestedPost(params: Omit<DeclineSuggestedPostParams, "chat_id" | "message_id">)