diff --git a/src/managers/RelationshipManager.js b/src/managers/RelationshipManager.js index bf3f099..5c33159 100644 --- a/src/managers/RelationshipManager.js +++ b/src/managers/RelationshipManager.js @@ -159,14 +159,14 @@ class RelationshipManager { /** * Sends a friend request. * @param {string} username Username of the user to send the request to - * @param {number} discriminator Discriminator of the user to send the request to + * @param {?number} discriminator Discriminator of the user to send the request to * @returns {Promise} */ async sendFriendRequest(username, discriminator) { await this.client.api.users('@me').relationships.post({ data: { username, - discriminator: parseInt(discriminator), + discriminator: discriminator == 0 ? null : parseInt(discriminator), }, headers: { 'X-Context-Properties': Buffer.from(JSON.stringify({ location: 'Add Friend' }), 'utf8').toString('base64'), diff --git a/typings/index.d.ts b/typings/index.d.ts index 4e2eb70..1e8447c 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -4410,7 +4410,7 @@ export class RelationshipManager { public fetch(user: UserResolvable, options?: BaseFetchOptions): Promise; public deleteFriend(user: UserResolvable): Promise; public deleteBlocked(user: UserResolvable): Promise; - public sendFriendRequest(username: string, discriminator: number): Promise; + public sendFriendRequest(username: string, discriminator?: number): Promise; public cancelFriendRequest(user: UserResolvable): Promise; public addFriend(user: UserResolvable): Promise; public addBlocked(user: UserResolvable): Promise;