mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
chore: util.deprecate fetchVanityCode
This commit is contained in:
@@ -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.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user