thelounge/src/plugins/inputs/disconnect.js

20 lines
527 B
JavaScript
Raw Normal View History

"use strict";
2017-08-18 21:04:16 +02:00
const Helper = require("../../helper");
2016-04-14 10:56:02 +02:00
exports.commands = ["disconnect"];
exports.allowDisconnected = true;
2016-04-14 10:56:02 +02:00
exports.input = function(network, chan, cmd, args) {
2018-01-11 12:33:36 +01:00
const quitMessage = args[0] ? args.join(" ") : Helper.config.leaveMessage;
2016-04-14 10:56:02 +02: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 10:56:02 +02:00
};