From 64e6dae193745f0ac1fce2be5b1bf1a13c926cfc Mon Sep 17 00:00:00 2001 From: Mantou <74487898+Mantou1233@users.noreply.github.com> Date: Tue, 19 Jul 2022 18:50:41 +0800 Subject: [PATCH] feat(RelationshipsManager): new cancelFriendRequest method --- src/managers/RelationshipsManager.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/managers/RelationshipsManager.js b/src/managers/RelationshipsManager.js index 2d371ed..de5e530 100644 --- a/src/managers/RelationshipsManager.js +++ b/src/managers/RelationshipsManager.js @@ -121,6 +121,16 @@ class RelationshipsManager { return true; } + /** + * Cancels a friend request. + * @param {Snowflake} snowflake Snowflake of the user you want to delete + * @returns {Promise} + */ + async cancelFriendRequest(id) { + await this.client.api.users['@me'].relationships[id].delete(); + return true; + } + /** * Accepts a friend request. * @param {UserResolvable} user The user to add as a friend