stringify message with flatted

This commit is contained in:
2019-04-26 05:44:07 +10:00
parent f9d25e211a
commit 1251f2918c
3 changed files with 8 additions and 3 deletions

5
package-lock.json generated
View File

@@ -516,6 +516,11 @@
"escape-string-regexp": "^1.0.5"
}
},
"flatted": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz",
"integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg=="
},
"fluent-ffmpeg": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.2.tgz",

View File

@@ -8,6 +8,7 @@
"@google-cloud/vision": "^0.25.0",
"colors": "^1.3.3",
"discord.js": "^11.4.2",
"flatted": "^2.0.0",
"fluent-ffmpeg": "^2.1.2",
"inquirer": "^6.2.2",
"mysql": "^2.16.0",

View File

@@ -1,8 +1,7 @@
const fs = require('fs');
const https = require('https');
const WebSocket = require('ws');
const { parse, stringify } = require('flatted/cjs');
module.exports = {
name: "Websockets Server (8080)",
@@ -42,7 +41,7 @@ module.exports = {
}))
dclient.on('message', (message) => {
ws.send(message.cleanContent)
ws.send(stringify(message))
})
});