Leave HypeSquad
This commit is contained in:
		@@ -142,6 +142,7 @@ class ClientUser extends User {
 | 
			
		||||
	/**
 | 
			
		||||
	 * Set HyperSquad House
 | 
			
		||||
	 * @param {HypeSquadOptions<Number|String>} type
 | 
			
		||||
	 * `LEAVE`: 0
 | 
			
		||||
	 * `HOUSE_BRAVERY`: 1
 | 
			
		||||
	 * `HOUSE_BRILLIANCE`: 2
 | 
			
		||||
	 * `HOUSE_BALANCE`: 3
 | 
			
		||||
@@ -149,13 +150,16 @@ class ClientUser extends User {
 | 
			
		||||
	 * @example
 | 
			
		||||
	 * // Set HyperSquad HOUSE_BRAVERY
 | 
			
		||||
	 * client.user.setHypeSquad(1); || client.user.setHypeSquad('HOUSE_BRAVERY');
 | 
			
		||||
	 * // Leave
 | 
			
		||||
	 * client.user.setHypeSquad(0);
 | 
			
		||||
	 */
 | 
			
		||||
	async setHypeSquad(type) {
 | 
			
		||||
		const id = typeof type === 'string' ? HypeSquadOptions[type] : type;
 | 
			
		||||
		if (!id) throw new Error('Invalid HypeSquad type.');
 | 
			
		||||
		return await this.client.api.hypesquad.online.post({
 | 
			
		||||
		if (!id && id !== 0) throw new Error('Invalid HypeSquad type.');
 | 
			
		||||
		if (id !== 0) return await this.client.api.hypesquad.online.post({
 | 
			
		||||
			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']);
 | 
			
		||||
/* 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');
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user