Skip to content

PrivateChat (API Reference)

ts
class PrivateChat<TContext extends Context = Context>

Properties

PropertyTypeDescription
idnumberChat ID (same as the user's ID)
type'private'Chat type discriminant
userUser<TContext>The user this chat belongs to
messagesMessagesLog<TContext>Bot messages sent to this private chat

Notes

PrivateChat has no dispatch methods of its own — all updates are dispatched through the User actor. The messages log tracks bot sends targeted at this private chat.

PrivateChat is auto-created when you call chats.newUser(). Access it via:

ts
const user = chats.newUser();
const dm = user.privateChat;
// or
const dm = chats.newPrivateChat(user); // returns the same instance

See also

Released under the MIT License.