Available methods

readBusinessMessage()

Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.

parameters

parametertyperequireddescription
business_connection_idstringrequiredUnique identifier of the business connection on behalf of which to read the message
chat_idnumberrequiredUnique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.
message_idnumberrequiredUnique identifier of the message to mark as read

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 { ReadBusinessMessageParams } from "@yaebal/types";

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

context shortcut

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

context shortcut
/** Marks incoming message as read on behalf of a business account. Requires the *can\_read\_messages* business bot right. Returns *True* on success. */
ctx.readBusinessMessage(params: Omit<ReadBusinessMessageParams, "chat_id" | "message_id">)