feat: throw vanity url error instead of returning rejected promise

Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
Johnson Chen
2020-04-25 18:13:53 +10:00
committed by GitHub
parent b82d9a38f0
commit 003ff4073d

View File

@@ -774,7 +774,7 @@ class Guild extends Base {
*/
async fetchVanityData() {
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();
this.vanityURLUses = data.uses;