HypeSquad

Created by catcat1204
Edited by aiko-chan-ai
This commit is contained in:
March 7th 2022-03-25 23:56:20 +07:00
parent 7250fa2dbd
commit a39bc31b58
5 changed files with 20 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "discord.js-selfbot-v13", "name": "discord.js-selfbot-v13",
"version": "1.1.0", "version": "1.1.1",
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]", "description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
"main": "./src/index.js", "main": "./src/index.js",
"types": "./typings/index.d.ts", "types": "./typings/index.d.ts",

View File

@ -2,6 +2,7 @@
const User = require('./User'); const User = require('./User');
const DataResolver = require('../util/DataResolver'); const DataResolver = require('../util/DataResolver');
const { HypeSquadOptions } = require('../util/Constants');
/** /**
* Represents the logged in client's Discord user. * Represents the logged in client's Discord user.
@ -108,14 +109,19 @@ class ClientUser extends User {
} }
/** /**
* Set HyperSquad House * Set HyperSquad House
* @param {number} id * @param {HypeSquadOptions<Number|String>} type
* `HOUSE_BRAVERY`: 1
* `HOUSE_BRILLIANCE`: 2
* `HOUSE_BALANCE`: 3
* @returns {Promise<void>} * @returns {Promise<void>}
* @example * @example
* // Set HyperSquad House * // Set HyperSquad HOUSE_BRAVERY
* client.user.setHyperSquadHouse(1); * client.user.setHypeSquad(1); || client.user.setHypeSquad('HOUSE_BRAVERY');
*/ */
setHypeSquad(id) { async setHypeSquad(type) {
this.client.api.hypesquad.online.post({ data: {house_id: id} }); const id = typeof type === 'string' ? HypeSquadOptions[type] : type;
if(!id) throw new Error('Invalid HypeSquad type.');
return await this.client.api.hypesquad.online.post({ data: {house_id: id} });
} }
/** /**

View File

@ -1183,6 +1183,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._cleanupSymbol = Symbol('djsCleanup'); exports._cleanupSymbol = Symbol('djsCleanup');

6
typings/enums.d.ts vendored
View File

@ -103,6 +103,12 @@ export const enum GuildScheduledEventStatuses {
CANCELED = 4, CANCELED = 4,
} }
export const enum HypeSquadOptions {
HOUSE_BRAVERY = 1,
HOUSE_BRILLIANCE = 2,
HOUSE_BALANCE = 3,
}
export const enum InteractionResponseTypes { export const enum InteractionResponseTypes {
PONG = 1, PONG = 1,
CHANNEL_MESSAGE_WITH_SOURCE = 4, CHANNEL_MESSAGE_WITH_SOURCE = 4,

2
typings/index.d.ts vendored
View File

@ -636,7 +636,7 @@ export class ClientUser extends User {
public setPresence(data: PresenceData): ClientPresence; public setPresence(data: PresenceData): ClientPresence;
public setStatus(status: PresenceStatusData, shardId?: number | number[]): ClientPresence; public setStatus(status: PresenceStatusData, shardId?: number | number[]): ClientPresence;
public setUsername(username: string): Promise<this>; public setUsername(username: string): Promise<this>;
public setHypeSquad(id: number): Promise<void>; public setHypeSquad(type: HypeSquadOptions<Number|String>): Promise<void>;
// Selfbot // Selfbot
public readonly nitro: boolean; public readonly nitro: boolean;
/** /**