...
This commit is contained in:
parent
feac3e4872
commit
98da8051f0
@ -26,7 +26,7 @@ class irc {
|
||||
const files = fs.readdirSync(`${__dirname}/irc/`);
|
||||
for(let file in files) {
|
||||
if(files[file].substr(-3, 3) === ".js") {
|
||||
logger.info(`loading cmd: ${files[file]}`);
|
||||
logger.debug(`(${this.network}) loading cmd: ${files[file]}`);
|
||||
require(`${__dirname}/irc/${files[file]}`)(this);
|
||||
}
|
||||
}
|
||||
@ -61,11 +61,11 @@ class irc {
|
||||
}
|
||||
send(data) {
|
||||
this.socket.write(`${data}\n`);
|
||||
logger.debug(`out: ${data}`);
|
||||
logger.debug(`(${this.network}) out: ${data}`);
|
||||
}
|
||||
parse(data, [a, ...b] = data.split(/ +:/)) {
|
||||
let tmp = a.split(" ").concat(b);
|
||||
logger.debug(`in: ${[...tmp]}`);
|
||||
logger.debug(`(${this.network}) in: ${[...tmp]}`);
|
||||
return data.charAt(0) === ":" ? {
|
||||
prefix: tmp.shift(),
|
||||
command: tmp.shift(),
|
||||
|
Loading…
Reference in New Issue
Block a user