mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
fix: add support for new guild feature GUILD_WEB_PAGE_VANITY_URL (#9219)
Co-authored-by: space <spaceeec@yahoo.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -633,9 +633,6 @@ class Guild extends AnonymousGuild {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
async fetchVanityData() {
|
async fetchVanityData() {
|
||||||
if (!this.features.includes(GuildFeature.VanityURL)) {
|
|
||||||
throw new DiscordjsError(ErrorCodes.VanityURL);
|
|
||||||
}
|
|
||||||
const data = await this.client.rest.get(Routes.guildVanityUrl(this.id));
|
const data = await this.client.rest.get(Routes.guildVanityUrl(this.id));
|
||||||
this.vanityURLCode = data.code;
|
this.vanityURLCode = data.code;
|
||||||
this.vanityURLUses = data.uses;
|
this.vanityURLUses = data.uses;
|
||||||
|
|||||||
Reference in New Issue
Block a user