mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
feat: throw vanity url error instead of returning rejected promise
Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
@@ -774,7 +774,7 @@ class Guild extends Base {
|
|||||||
*/
|
*/
|
||||||
async fetchVanityData() {
|
async fetchVanityData() {
|
||||||
if (!this.features.includes('VANITY_URL')) {
|
if (!this.features.includes('VANITY_URL')) {
|
||||||
return Promise.reject(new Error('VANITY_URL'));
|
throw new Error('VANITY_URL');
|
||||||
}
|
}
|
||||||
const data = await this.client.api.guilds(this.id, 'vanity-url').get();
|
const data = await this.client.api.guilds(this.id, 'vanity-url').get();
|
||||||
this.vanityURLUses = data.uses;
|
this.vanityURLUses = data.uses;
|
||||||
|
|||||||
Reference in New Issue
Block a user