hardlounge/src/plugins/inputs/disconnect.js

20 lines
527 B
JavaScript
Raw Normal View History

"use strict";
2017-08-18 19:04:16 +00:00
const Helper = require("../../helper");
2016-04-14 08:56:02 +00:00
exports.commands = ["disconnect"];
exports.allowDisconnected = true;
2016-04-14 08:56:02 +00:00
exports.input = function(network, chan, cmd, args) {
2018-01-11 11:33:36 +00:00
const quitMessage = args[0] ? args.join(" ") : Helper.config.leaveMessage;
2016-04-14 08:56:02 +00:00
// Even if we are disconnected, but there is an internal connection object
// pass the quit/end to it, so the reconnection timer stops
if (network.irc && network.irc.connection) {
network.irc.quit(quitMessage);
}
network.userDisconnected = true;
this.save();
2016-04-14 08:56:02 +00:00
};