mirror of
https://github.com/ION606/custom_discordjs.git
synced 2026-05-14 22:26:54 +00:00
bug fixes
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"name": "iondiscordjs",
|
"name": "iondiscordjs",
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"description": "because discord.js is annoying",
|
"description": "because discord.js is annoying",
|
||||||
"main": "tests\\test.js",
|
"main": "tests/test.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -69,8 +69,7 @@ export class Client extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* @param {Number} hbint
|
* @param {Number} hbint
|
||||||
*/
|
*/
|
||||||
async #startHeartBeat(hbint)
|
async #startHeartBeat(hbint) {
|
||||||
{
|
|
||||||
this.heartBeatInterval = hbint;
|
this.heartBeatInterval = hbint;
|
||||||
console.log("INTERVAL SET TO: " + this.heartBeatInterval);
|
console.log("INTERVAL SET TO: " + this.heartBeatInterval);
|
||||||
this.#heartbeat(hbint);
|
this.#heartbeat(hbint);
|
||||||
@@ -87,8 +86,11 @@ export class Client extends EventEmitter {
|
|||||||
this.user_settings = response.config;
|
this.user_settings = response.config;
|
||||||
this.id = response.profile.id;
|
this.id = response.profile.id;
|
||||||
|
|
||||||
|
if (!this.isUser) {
|
||||||
const commandsRaw = (await this.axiosCustom.get(`applications/${this.id}/commands`)).data;
|
const commandsRaw = (await this.axiosCustom.get(`applications/${this.id}/commands`)).data;
|
||||||
this.commands = new InteractionManager(commandsRaw, this);
|
this.commands = new InteractionManager(commandsRaw, this);
|
||||||
|
}
|
||||||
|
|
||||||
this.emit('ready');
|
this.emit('ready');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,12 +168,13 @@ export class Client extends EventEmitter {
|
|||||||
return response;
|
return response;
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
console.log(err.response.data);
|
console.log(err.response.data);
|
||||||
throw `REQUEST FAILED WITH STATUS CODE ${err.response.status} AND REASON "${JSON.stringify(err.response.data)}"`;
|
// throw `REQUEST FAILED WITH STATUS CODE ${err.response.status} AND REASON "${JSON.stringify(err.response.data)}"`;
|
||||||
});
|
});
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.ws = new WebSocket("wss://gateway.discord.gg/?v=10&encoding=json");
|
this.ws = new WebSocket("wss://gateway.discord.gg/?v=9&encoding=json");
|
||||||
this.#token = token;
|
this.#token = token;
|
||||||
|
this.isUser = isUser;
|
||||||
|
|
||||||
this.ws.on('open', () => {
|
this.ws.on('open', () => {
|
||||||
//Get the user intents
|
//Get the user intents
|
||||||
|
|||||||
Reference in New Issue
Block a user