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
| parameter | type | required | description |
|---|---|---|---|
user_id | number | required | Unique identifier for the target user |
limit | number | required | The maximum number of messages to return; 1-20 |
returns
Message[]
usage in yaebal
getUserPersonalChatMessages is directly typed on Api — call it straight off bot.api.
import type { GetUserPersonalChatMessagesParams } from "@yaebal/types";
await bot.api.getUserPersonalChatMessages({
user_id: 123456789,
limit: 1,
} satisfies GetUserPersonalChatMessagesParams);context shortcut
also available as ctx.getUserPersonalChatMessages() on
16
context types — see @yaebal/contexts.
/** 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"> & { user_id?: number })official Bot API docs: https://core.telegram.org/bots/api/#getuserpersonalchatmessages