Skip to content

Instantly share code, notes, and snippets.

@monstaro
Last active June 4, 2021 16:46
Show Gist options
  • Save monstaro/646929949ee79e0fcb297a780bb0264d to your computer and use it in GitHub Desktop.
Save monstaro/646929949ee79e0fcb297a780bb0264d to your computer and use it in GitHub Desktop.
Channel Method Examples
{
  channel: {
    id: 'my-new-channel',
    type: 'messaging',
    cid: 'messaging:my-new-channel',
    last_message_at: '2021-06-04T16:34:23.884405Z',
    created_at: '2021-06-04T16:25:04.510838Z',
    updated_at: '2021-06-04T16:25:04.510838Z',
    created_by: {
      id: 'Cody',
      role: 'user',
      created_at: '2021-03-25T17:31:36.528874Z',
      updated_at: '2021-04-28T20:34:58.612221Z',
      last_active: '2021-06-04T16:37:23.246732764Z',
      banned: false,
      online: true,
      extraData: [Object]
    },
    frozen: false,
    disabled: false,
    member_count: 3,
    config: {
      created_at: '2021-04-08T22:19:47.950153Z',
      updated_at: '2021-05-26T17:12:40.73503Z',
      name: 'messaging',
      typing_events: true,
      read_events: true,
      connect_events: true,
      search: true,
      reactions: true,
      replies: true,
      mutes: true,
      uploads: true,
      url_enrichment: true,
      custom_events: true,
      push_notifications: true,
      message_retention: 'infinite',
      max_message_length: 5000,
      automod: 'disabled',
      automod_behavior: 'flag',
      blocklist: 'profanity_en_2020_v1',
      blocklist_behavior: 'block',
      automod_thresholds: {},
      commands: [Array]
    }
  },
  messages: [],
  pinned_messages: [],
  members: [
    {
      user_id: 'Cody',
      user: [Object],
      role: 'owner',
      created_at: '2021-06-04T16:25:04.513315Z',
      updated_at: '2021-06-04T16:25:04.513315Z',
      banned: false,
      shadow_banned: false
    },
    {
      user_id: 'Stephen',
      user: [Object],
      role: 'member',
      created_at: '2021-06-04T16:25:04.513316Z',
      updated_at: '2021-06-04T16:25:04.513316Z',
      banned: false,
      shadow_banned: false
    },
    {
      user_id: 'Suki',
      user: [Object],
      role: 'member',
      created_at: '2021-06-04T16:25:04.513316Z',
      updated_at: '2021-06-04T16:25:04.513316Z',
      banned: false,
      shadow_banned: false
    }
  ],
  membership: {
    user: {
      id: 'Cody',
      role: 'user',
      created_at: '2021-03-25T17:31:36.528874Z',
      updated_at: '2021-04-28T20:34:58.612221Z',
      last_active: '2021-06-04T16:37:23.246732764Z',
      banned: false,
      online: true,
      extraData: [Object]
    },
    role: 'owner',
    created_at: '2021-06-04T16:25:04.513315Z',
    updated_at: '2021-06-04T16:25:04.513315Z',
    banned: false,
    shadow_banned: false
  },
  duration: '1.97ms'
}
{
  channel: {
    id: 'my-new-channel',
    type: 'messaging',
    cid: 'messaging:my-new-channel',
    last_message_at: '2021-06-04T16:34:23.884405Z',
    created_at: '2021-06-04T16:25:04.510838Z',
    updated_at: '2021-06-04T16:25:04.510838Z',
    created_by: {
      id: 'Cody',
      role: 'user',
      created_at: '2021-03-25T17:31:36.528874Z',
      updated_at: '2021-04-28T20:34:58.612221Z',
      last_active: '2021-06-04T16:45:26.884330639Z',
      banned: false,
      online: true,
      extraData: [Object]
    },
    frozen: false,
    disabled: false,
    member_count: 3,
    config: {
      created_at: '2021-04-08T22:19:47.950153Z',
      updated_at: '2021-05-26T17:12:40.73503Z',
      name: 'messaging',
      typing_events: true,
      read_events: true,
      connect_events: true,
      search: true,
      reactions: true,
      replies: true,
      mutes: true,
      uploads: true,
      url_enrichment: true,
      custom_events: true,
      push_notifications: true,
      message_retention: 'infinite',
      max_message_length: 5000,
      automod: 'disabled',
      automod_behavior: 'flag',
      blocklist: 'profanity_en_2020_v1',
      blocklist_behavior: 'block',
      automod_thresholds: {},
      commands: [Array]
    }
  },
  messages: [
    {
      id: '8fb7d1f8-6858-4474-a7ea-bf35e49658c3',
      text: 'Welcome to the channel!',
      html: '<p>Welcome to the channel!</p>\n',
      type: 'regular',
      user: [Object],
      attachments: [],
      latest_reactions: [],
      own_reactions: [],
      reaction_counts: {},
      reaction_scores: null,
      reply_count: 0,
      cid: 'messaging:my-new-channel',
      created_at: '2021-06-04T16:34:23.884405Z',
      updated_at: '2021-06-04T16:34:23.884405Z',
      shadowed: false,
      mentioned_users: [],
      silent: false,
      pinned: false,
      pinned_at: null,
      pinned_by: null,
      pin_expires: null
    }
  ],
  pinned_messages: [],
  watcher_count: 2,
  read: [
    {
      user: [Object],
      last_read: '2021-06-04T16:25:04.523021568Z',
      unread_messages: 1
    },
    {
      user: [Object],
      last_read: '2021-06-04T16:25:04.522258688Z',
      unread_messages: 1
    },
    {
      user: [Object],
      last_read: '2021-06-04T16:25:04.521484288Z',
      unread_messages: 0
    }
  ],
  members: [
    {
      user_id: 'Cody',
      user: [Object],
      role: 'owner',
      created_at: '2021-06-04T16:25:04.513315Z',
      updated_at: '2021-06-04T16:25:04.513315Z',
      banned: false,
      shadow_banned: false
    },
    {
      user_id: 'Stephen',
      user: [Object],
      role: 'member',
      created_at: '2021-06-04T16:25:04.513316Z',
      updated_at: '2021-06-04T16:25:04.513316Z',
      banned: false,
      shadow_banned: false
    },
    {
      user_id: 'Suki',
      user: [Object],
      role: 'member',
      created_at: '2021-06-04T16:25:04.513316Z',
      updated_at: '2021-06-04T16:25:04.513316Z',
      banned: false,
      shadow_banned: false
    }
  ],
  membership: {
    user: {
      id: 'Cody',
      role: 'user',
      created_at: '2021-03-25T17:31:36.528874Z',
      updated_at: '2021-04-28T20:34:58.612221Z',
      last_active: '2021-06-04T16:45:26.884330639Z',
      banned: false,
      online: true,
      extraData: [Object]
    },
    role: 'owner',
    created_at: '2021-06-04T16:25:04.513315Z',
    updated_at: '2021-06-04T16:25:04.513315Z',
    banned: false,
    shadow_banned: false
  },
  duration: '6.20ms'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment