Available methods

getUserPersonalChatMessages()

Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. On success, an array of Message objects is returned.

parameters

parametertyperequireddescription
user_idnumberrequiredUnique identifier for the target user
limitnumberrequiredThe maximum number of messages to return; 1-20

returns

Message[]

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

await bot.api.call<Message[]>("getUserPersonalChatMessages", {
  user_id: 123456789,
  limit: 1,
} satisfies GetUserPersonalChatMessagesParams);

context shortcut

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

context shortcut
/** Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. On success, an array of [Message](https://core.telegram.org/bots/api/#message) objects is returned. */
ctx.getUserPersonalChatMessages(params: Omit<GetUserPersonalChatMessagesParams, "user_id">)