Skip to content

Commit 1c275af

Browse files
authored
fix(Guild): fix vanityURLUses desc, internally use fetchVanityData (#4335)
* docs(vanityURLUses): use fetchVanityData * feat(fetchVanityCode): internally call fetchVanityData * Update src/structures/Guild.js
1 parent 8030612 commit 1c275af

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/structures/Guild.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class Guild extends Base {
336336
/* eslint-disable max-len */
337337
/**
338338
* The use count of the vanity URL code of the guild, if any
339-
* <info>You will need to fetch the guild using {@link Guild#fetchVanityCode} if you want to receive this parameter</info>
339+
* <info>You will need to fetch this parameter using {@link Guild#fetchVanityData} if you want to receive it</info>
340340
* @type {?number}
341341
*/
342342
this.vanityURLUses = null;
@@ -771,13 +771,7 @@ class Guild extends Base {
771771
* .catch(console.error);
772772
*/
773773
fetchVanityCode() {
774-
if (!this.features.includes('VANITY_URL')) {
775-
return Promise.reject(new Error('VANITY_URL'));
776-
}
777-
return this.client.api
778-
.guilds(this.id, 'vanity-url')
779-
.get()
780-
.then(res => res.code);
774+
return this.fetchVanityData().then(vanity => vanity.code);
781775
}
782776

783777
/**

0 commit comments

Comments
 (0)