채널 정보 업데이트

  • 채널의 정보를 업데이트 할 수 있습니다.

  • data의 경우, 최대 5개의 key-value pair를 입력할 수 있습니다. key의 최대 size는 128자 이고 최대 value size는 1024자입니다. Key, value 둘 다 문자열이어야 합니다.

await client.updateChannel({
      channelId: 'my_channel', // required
      name: 'my_channel', // optional 
      imageUrl : 'image URL', // optional
      maxMemberCount: 10, // optional. default 100
      hideMessagesBeforeJoin: true,
      category: 'category A', // optional
      subcategory: 'category B', // optional
      data: { // optional
        someMetaKey1: "someMetaValue1",
        someMetaKey2: "someMetaValue2",
      },
    });
    
// INVITATION ONLY 채널 수정 시,
await client.updateChannel({
      channelId: 'my_invitation_only_channel',
      name: 'my_invitation_only_channel',
      imageUrl : 'image URL', // optional
      maxMemberCount: 10, // optional. default 100
      hideMessagesBeforeJoin: true,
      category: 'category A', // optional
      subcategory: 'category B', // optional
      invitationCode: 'secret_phrase',
      data: { // optional
        someMetaKey1: "someMetaValue1",
        someMetaKey2: "someMetaValue2",
      },
    });

Response

{
  "channel": {
    "id": "my_channel",
    "name": "my_channel",
    "imageUrl": "image url",
    "data": {
      "someMetaKey1": "someMetaValue1",
      "someMetaKey2": "someMetaValue2"
    },
    "ownerId": "user123",
    "pushNotificationDisabled": false,
    "type": "private",
    "invitationCode": "",
    "isFrozen": false,
    "memberCount": 2,
    "maxMemberCount": 10,
    "hideMessagesBeforeJoin": true,
    "category": "test",
    "subcategory": "",
    "privateTag": "",
    "privateData": "",
    "mutedUsers": [],
    "members": [
      {
        "id": "user123",
        "username": "john",
        "profileImageUrl": "http://cnd.test.com/123.jpg",
        "data": {},
        "memberInfo": {},
        "updatedAt": 1603244896634,
        "createdAt": 1603184094285,
        "lastReadAt": 1603244933412,
        "lastSentAt": 1603244933412
      },
      {
        "id": "another_user_id",
        "username": "another_user_id",
        "profileImageUrl": "http://cnd.test.com/another_user.jpg",
        "data": {},
        "memberInfo": {},
        "updatedAt": 1603244410844,
        "createdAt": 1603244410844,
        "lastReadAt": 1603244933412,
        "lastSentAt": 1603244933412
      }
    ],
    "bannedUsers": [],
    "pushNotificationDisabled": false,
    "pushNotificationSoundAOS": "",
    "pushNotificationSoundIOS": "",
    "updatedAt": 0,
    "createdAt": 0,
    "unreadCount": 0,
    "lastReadAt": 0,
    "lastMessage": null
  }
}

Last updated