fix: throw Error instead of rejecting Promise

This commit is contained in:
Johnson Chen
2020-05-12 02:22:52 +10:00
parent e6ce10431d
commit 7ffd53eba4

View File

@@ -749,7 +749,7 @@ class Guild extends Base {
*/
fetchVanityCode() {
if (!this.features.includes('VANITY_URL')) {
return Promise.reject(new Error('VANITY_URL'));
throw new Error('VANITY_URL');
}
return this.client.api
.guilds(this.id, 'vanity-url')