From 4cb7ff4f25b40c1428028e00724c15a7332df78c Mon Sep 17 00:00:00 2001
From: Jiralite <33201955+Jiralite@users.noreply.github.com>
Date: Wed, 29 Sep 2021 11:26:32 +0100
Subject: [PATCH 1/3] fix: nullable name
---
src/structures/PartialGroupDMChannel.js | 2 +-
typings/index.d.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/structures/PartialGroupDMChannel.js b/src/structures/PartialGroupDMChannel.js
index 4950fcb3b601..9f6cb753efd1 100644
--- a/src/structures/PartialGroupDMChannel.js
+++ b/src/structures/PartialGroupDMChannel.js
@@ -13,7 +13,7 @@ class PartialGroupDMChannel extends Channel {
/**
* The name of this Group DM Channel
- * @type {string}
+ * @type {?string}
*/
this.name = data.name;
diff --git a/typings/index.d.ts b/typings/index.d.ts
index bb8e8293e706..c5834dd3e94d 100644
--- a/typings/index.d.ts
+++ b/typings/index.d.ts
@@ -1510,7 +1510,7 @@ export class OAuth2Guild extends BaseGuild {
export class PartialGroupDMChannel extends Channel {
public constructor(client: Client, data: RawPartialGroupDMChannelData);
- public name: string;
+ public name: string | null;
public icon: string | null;
public iconURL(options?: StaticImageURLOptions): string | null;
}
From 4034a3e80dcc38a1d442fd9992e2327bb45f4961 Mon Sep 17 00:00:00 2001
From: Jiralite <33201955+Jiralite@users.noreply.github.com>
Date: Wed, 29 Sep 2021 11:41:02 +0100
Subject: [PATCH 2/3] feat: add recipients
---
src/structures/PartialGroupDMChannel.js | 7 +++++++
typings/index.d.ts | 1 +
2 files changed, 8 insertions(+)
diff --git a/src/structures/PartialGroupDMChannel.js b/src/structures/PartialGroupDMChannel.js
index 9f6cb753efd1..2928c596bbcb 100644
--- a/src/structures/PartialGroupDMChannel.js
+++ b/src/structures/PartialGroupDMChannel.js
@@ -22,6 +22,13 @@ class PartialGroupDMChannel extends Channel {
* @type {?string}
*/
this.icon = data.icon;
+
+ /**
+ * The recipients of this Group DM Channel.
+ * This is an array of usernames
+ * @type {string[]}
+ */
+ this.recipients = data.recipients;
}
/**
diff --git a/typings/index.d.ts b/typings/index.d.ts
index c5834dd3e94d..49732e586353 100644
--- a/typings/index.d.ts
+++ b/typings/index.d.ts
@@ -1512,6 +1512,7 @@ export class PartialGroupDMChannel extends Channel {
public constructor(client: Client, data: RawPartialGroupDMChannelData);
public name: string | null;
public icon: string | null;
+ public recipients: string[];
public iconURL(options?: StaticImageURLOptions): string | null;
}
From 88578abaf38597c599e519f4b618dbb854a9d32d Mon Sep 17 00:00:00 2001
From: Jiralite <33201955+Jiralite@users.noreply.github.com>
Date: Wed, 29 Sep 2021 11:52:56 +0100
Subject: [PATCH 3/3] feat: partial recipient type
---
src/structures/PartialGroupDMChannel.js | 9 +++++++--
typings/index.d.ts | 6 +++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/structures/PartialGroupDMChannel.js b/src/structures/PartialGroupDMChannel.js
index 2928c596bbcb..6d7f1e0d38da 100644
--- a/src/structures/PartialGroupDMChannel.js
+++ b/src/structures/PartialGroupDMChannel.js
@@ -23,10 +23,15 @@ class PartialGroupDMChannel extends Channel {
*/
this.icon = data.icon;
+ /**
+ * Recipient data received in a {@link PartialGroupDMChannel}.
+ * @typedef {Object} PartialRecipient
+ * @property {string} username The username of the recipient
+ */
+
/**
* The recipients of this Group DM Channel.
- * This is an array of usernames
- * @type {string[]}
+ * @type {PartialRecipient[]}
*/
this.recipients = data.recipients;
}
diff --git a/typings/index.d.ts b/typings/index.d.ts
index 49732e586353..779c1b453418 100644
--- a/typings/index.d.ts
+++ b/typings/index.d.ts
@@ -1512,7 +1512,7 @@ export class PartialGroupDMChannel extends Channel {
public constructor(client: Client, data: RawPartialGroupDMChannelData);
public name: string | null;
public icon: string | null;
- public recipients: string[];
+ public recipients: PartialRecipient[];
public iconURL(options?: StaticImageURLOptions): string | null;
}
@@ -4543,6 +4543,10 @@ export type RecursiveArray = ReadonlyArray>;
export type RecursiveReadonlyArray = ReadonlyArray>;
+export interface PartialRecipient {
+ username: string;
+}
+
export type PremiumTier = keyof typeof PremiumTiers;
export interface PresenceData {