@wildix/xbees-conversations-client > PinChannelCommand
PinChannelCommand class
Marks the channel with a pin flag. A user can have up to 10 pinned channels. If a user tries to pin more than 10 channels, the system will remove the oldest channel if the force flag is specified; otherwise, a PinnedChannelsLimitReachedException will be thrown. The system will automatically remove the channel from pinned list if the user leaves the channel or if the channel is removed. This operation is idempotent, meaning that if the channel is already pinned, no error will be thrown.
Signature:
export declare class PinChannelCommand extends PinChannelCommand_base
Extends: PinChannelCommand_base
Example
Use a bare-bones client and the command you need to make an API call.
import { ConversationsClient, PinChannelCommand } from "@wildix/xbees-conversations-client"; // ES Modules import
// const { ConversationsClient, PinChannelCommand } = require("@wildix/xbees-conversations-client"); // CommonJS import
const client = new ConversationsClient(config);
const input = { // PinChannelInput
channelId: "STRING_VALUE", // required
userId: "STRING_VALUE",
force: true || false,
};
const command = new PinChannelCommand(input);
const response = await client.send(command);
// {};