parent
d4ac6d6d05
commit
3510a51529
@ -0,0 +1,20 @@ |
||||
const Discord = require('discord.js'); |
||||
|
||||
const ws = require('ws'); |
||||
|
||||
module.exports = { |
||||
name: "logger", |
||||
aliases: [], |
||||
meta: { |
||||
category: 'Developer', |
||||
description: "Websocket logs cause im cool", |
||||
syntax: '`nonya`', |
||||
extra: null |
||||
}, |
||||
help: "Websocket logs cause im cool", |
||||
async execute(message, msg, args, cmd, prefix, mention, client) { |
||||
if (!client.developers.includes(message.author.id)) {return message.channel.send("Fuck off");} |
||||
client.misc.loggers[args[0]] = new ws(`ws://${args[1]}:${args[2]}`); |
||||
return message.channel.send("Logger set"); |
||||
} |
||||
}; |
@ -0,0 +1,13 @@ |
||||
const ws = require('ws'); |
||||
const chalk = require('chalk'); |
||||
|
||||
const port = 1029; |
||||
|
||||
const wss = new ws.Server({port: port}); |
||||
|
||||
console.log(`\n${chalk.white("[BOOT]")} >> ${chalk.greenBright(`Initialized Websocket on`)} ${chalk.white(`port ${port}`)}\n`); |
||||
|
||||
wss.on('connection', (ws) => { |
||||
console.log(`\n${chalk.white("[SCKT]")} >> ${chalk.blue("Received new websocket connection")}\n`); |
||||
ws.on('message', (msg) => {console.log(msg);}); |
||||
}); |
Loading…
Reference in new issue