chore: util.deprecate fetchVanityCode

This commit is contained in:
Johnson Chen
2020-04-20 03:16:54 +10:00
parent 89bd207376
commit 5c8c56206f

View File

@@ -737,6 +737,7 @@ class Guild extends Base {
* .catch(console.error); * .catch(console.error);
*/ */
fetchVanityCode() { fetchVanityCode() {
return require('util').deprecate(() => {
if (!this.features.includes('VANITY_URL')) { if (!this.features.includes('VANITY_URL')) {
return Promise.reject(new Error('VANITY_URL')); return Promise.reject(new Error('VANITY_URL'));
} }
@@ -744,6 +745,7 @@ class Guild extends Base {
.guilds(this.id, 'vanity-url') .guilds(this.id, 'vanity-url')
.get() .get()
.then(res => res.code); .then(res => res.code);
}, 'fetchVanityCode() is deprecated. Use fetchVanityData() instead.');
} }
/** /**