Overview

The Chat Management module provides functionality to retrieve, view, archive, and manage chats within your communication channels. These methods allow you to efficiently organize conversations and access chat history.

Available Methods

All Chat

Retrieve a list of all chats with pagination support.
use CrunchzApp\CrunchzApp;

CrunchzApp::channel()
  ->allChat(
    limit: 12,
    offset: 1,
  );
The allChat method returns chats sorted by most recent activity by default.

Chat Details

Retrieve detailed information about a specific chat with a contact.
use CrunchzApp\CrunchzApp;

CrunchzApp::channel()
  ->contact('xxx@c.us')
  ->chatDetail();

Archive Chat

Archive a chat to organize your chat list and hide less active conversations.
use CrunchzApp\CrunchzApp;

CrunchzApp::channel()
  ->contact('xxx@c.us')
  ->archiveChat();
Archiving a chat doesn’t delete any messages. It simply moves the chat to the archived section.

Unarchive Chat

Restore a previously archived chat to your active chat list.
use CrunchzApp\CrunchzApp;

CrunchzApp::channel()
  ->contact('xxx@c.us')
  ->unArchiveChat();

Common Use Cases

Use the archive and unarchive features to keep your active chat list clean and focused on current conversations.
Use the chat details method to display complete conversation history with a specific contact.
Combine these methods to create a full-featured chat interface with pagination, archiving, and detailed views.