Guides

Archived ChatsUSER-ONLY

User Walkthrough 11 of 18

User clients can move chats between the main and archived chat lists.

Archiving a Chat

Use archiveChat with the chat’s identifier.

await client.archiveChat(chatId);

Listing Archived Chats

Use getChats with from set to "archived".

const chats = await client.getChats({ from: "archived" });

for (const { chat } of chats) {
  console.log(chat.id, chat.type);
}

Unarchiving a Chat

Use unarchiveChat with the chat’s identifier.

await client.unarchiveChat(chatId);