From 5c8c56206fb3cce7dbd1b9e45d2e56e54af55a56 Mon Sep 17 00:00:00 2001 From: Johnson Chen Date: Mon, 20 Apr 2020 03:16:54 +1000 Subject: [PATCH] chore: util.deprecate fetchVanityCode --- src/structures/Guild.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/structures/Guild.js b/src/structures/Guild.js index f7c6b76d0..9f1786604 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -737,13 +737,15 @@ class Guild extends Base { * .catch(console.error); */ fetchVanityCode() { - if (!this.features.includes('VANITY_URL')) { - return Promise.reject(new Error('VANITY_URL')); - } - return this.client.api - .guilds(this.id, 'vanity-url') - .get() - .then(res => res.code); + return require('util').deprecate(() => { + if (!this.features.includes('VANITY_URL')) { + return Promise.reject(new Error('VANITY_URL')); + } + return this.client.api + .guilds(this.id, 'vanity-url') + .get() + .then(res => res.code); + }, 'fetchVanityCode() is deprecated. Use fetchVanityData() instead.'); } /**