Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.71 KB

File metadata and controls

51 lines (34 loc) · 1.71 KB

stream-cli chat truncate-channel

Truncate a channel

Synopsis

Truncates a channel by removing all messages but keeping the channel metadata and members.

Optional flags allow you to perform a hard delete, add a system message, skip push notifications, and define the truncating user ID (for server-side calls).

stream-cli chat truncate-channel --type [channel-type] --id [channel-id] [flags]

Examples

# Truncate messages in 'general' channel of type messaging
$ stream-cli chat truncate-channel --type messaging --id general

# Truncate with hard delete and system message
$ stream-cli chat truncate-channel --type messaging --id general --hard --message "Channel reset" --user-id system-user

Options

      --hard                     [optional] Permanently delete messages instead of hiding them
  -h, --help                     help for truncate-channel
  -i, --id string                [required] Channel ID
      --message string           [optional] System message to include in truncation (requires --message-user-id)
      --message-user-id string   [optional] User id for the message to include in truncation (required if --message is set)
      --skip-push                [optional] Skip push notifications
  -t, --type string              [required] Channel type such as 'messaging'
      --user-id string           [optional] User ID who performs the truncation

Options inherited from parent commands

      --app string      [optional] Application name to use as it's defined in the configuration file
      --config string   [optional] Explicit config file path

SEE ALSO