Skip to content

Commit

Permalink
hotfix: removed axios broken with pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
Stalker2106x committed Aug 24, 2023
1 parent 2bd6c3d commit d1a089f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 769 deletions.
2 changes: 1 addition & 1 deletion App.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class App {
}

initChat() {
this.chatWorker = new Worker("./Chat", { workerData: { config: this.config } });
this.chatWorker = new Worker(path.join(__dirname, 'Chat.js'), { workerData: { config: this.config } });
}

async run () {
Expand Down
6 changes: 4 additions & 2 deletions Chat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const net = require('net')
const axios = require('axios').default
const xmljs = require('xml-js')
const { workerData, parentPort } = require('node:worker_threads');

Expand Down Expand Up @@ -38,7 +37,10 @@ class Chat {

broadcast(payload, rawData) {
if (this.config.chatDiscordWebhook && this.config.chatDiscordWebhook !== '') {
axios.post(webHook, { username: payload.racine.pseudo, content: payload.racine.msg })
fetch(this.config.chatDiscordWebhook, {
method: "POST",
body: JSON.stringify({ username: payload.racine.pseudo, content: payload.racine.msg }),
})
}
for (const client of this.clients) {
client.socket.write(rawData+'\0')
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"author": "stalker2106",
"license": "ISC",
"dependencies": {
"axios": "^1.4.0",
"body-parser": "^1.20.2",
"chalk": "4.1.2",
"express": "4.18.2",
Expand Down
Loading

0 comments on commit d1a089f

Please sign in to comment.