Leave HypeSquad
This commit is contained in:
parent
26d9e4cbb9
commit
cddbe4f9bb
@ -142,6 +142,7 @@ class ClientUser extends User {
|
|||||||
/**
|
/**
|
||||||
* Set HyperSquad House
|
* Set HyperSquad House
|
||||||
* @param {HypeSquadOptions<Number|String>} type
|
* @param {HypeSquadOptions<Number|String>} type
|
||||||
|
* `LEAVE`: 0
|
||||||
* `HOUSE_BRAVERY`: 1
|
* `HOUSE_BRAVERY`: 1
|
||||||
* `HOUSE_BRILLIANCE`: 2
|
* `HOUSE_BRILLIANCE`: 2
|
||||||
* `HOUSE_BALANCE`: 3
|
* `HOUSE_BALANCE`: 3
|
||||||
@ -149,13 +150,16 @@ class ClientUser extends User {
|
|||||||
* @example
|
* @example
|
||||||
* // Set HyperSquad HOUSE_BRAVERY
|
* // Set HyperSquad HOUSE_BRAVERY
|
||||||
* client.user.setHypeSquad(1); || client.user.setHypeSquad('HOUSE_BRAVERY');
|
* client.user.setHypeSquad(1); || client.user.setHypeSquad('HOUSE_BRAVERY');
|
||||||
|
* // Leave
|
||||||
|
* client.user.setHypeSquad(0);
|
||||||
*/
|
*/
|
||||||
async setHypeSquad(type) {
|
async setHypeSquad(type) {
|
||||||
const id = typeof type === 'string' ? HypeSquadOptions[type] : type;
|
const id = typeof type === 'string' ? HypeSquadOptions[type] : type;
|
||||||
if (!id) throw new Error('Invalid HypeSquad type.');
|
if (!id && id !== 0) throw new Error('Invalid HypeSquad type.');
|
||||||
return await this.client.api.hypesquad.online.post({
|
if (id !== 0) return await this.client.api.hypesquad.online.post({
|
||||||
data: { house_id: id },
|
data: { house_id: id },
|
||||||
});
|
});
|
||||||
|
else return await this.client.api.hypesquad.online.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1327,7 +1327,7 @@ exports.GuildScheduledEventStatuses = createEnum([null, 'SCHEDULED', 'ACTIVE', '
|
|||||||
*/
|
*/
|
||||||
exports.GuildScheduledEventEntityTypes = createEnum([null, 'STAGE_INSTANCE', 'VOICE', 'EXTERNAL']);
|
exports.GuildScheduledEventEntityTypes = createEnum([null, 'STAGE_INSTANCE', 'VOICE', 'EXTERNAL']);
|
||||||
/* eslint-enable max-len */
|
/* eslint-enable max-len */
|
||||||
exports.HypeSquadOptions = createEnum([null, 'HOUSE_BRAVERY', 'HOUSE_BRILLIANCE', 'HOUSE_BALANCE']);
|
exports.HypeSquadOptions = createEnum(['LEAVE', 'HOUSE_BRAVERY', 'HOUSE_BRILLIANCE', 'HOUSE_BALANCE']);
|
||||||
|
|
||||||
exports._cleanupSymbol = Symbol('djsCleanup');
|
exports._cleanupSymbol = Symbol('djsCleanup');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user