diff --git a/.pubnub.yml b/.pubnub.yml index 85c101c..04939f3 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,11 +1,16 @@ --- name: pubnub-js-chat -version: v0.5.0 +version: v0.5.1 scm: github.com/pubnub/js-chat schema: 1 files: - lib/dist/index.js changelog: + - date: 2023-12-18 + version: v0.5.1 + changes: + - type: feature + text: "Add missing "reason" parameter to user restrictions." - date: 2023-12-14 version: v0.5.0 changes: diff --git a/lib/package.json b/lib/package.json index 591fa01..424455e 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@pubnub/chat", - "version": "0.5.0", + "version": "0.5.1", "description": "PubNub JavaScript Chat SDK", "author": "PubNub ", "license": "SEE LICENSE IN LICENSE", diff --git a/lib/src/entities/user.ts b/lib/src/entities/user.ts index 9b34a5d..b456163 100644 --- a/lib/src/entities/user.ts +++ b/lib/src/entities/user.ts @@ -149,7 +149,10 @@ export class User { * Moderation restrictions */ - async setRestrictions(channel: Channel, params: { ban?: boolean; mute?: boolean }) { + async setRestrictions( + channel: Channel, + params: { ban?: boolean; mute?: boolean; reason?: string } + ) { if (!(this.chat.sdk as any)._config.secretKey) throw "Moderation restrictions can only be set by clients initialized with a Secret Key." return this.chat.setRestrictions(this.id, channel.id, params)