diff --git a/src/plugins/inputs/connect.js b/src/plugins/inputs/connect.js index 538cd4a2..04296247 100644 --- a/src/plugins/inputs/connect.js +++ b/src/plugins/inputs/connect.js @@ -1,8 +1,24 @@ +var Msg = require("../../models/msg"); + exports.commands = ["connect", "server"]; exports.allowDisconnected = true; exports.input = function(network, chan, cmd, args) { if (args.length === 0) { + if (!network.irc || !network.irc.connection) { + return; + } + + if (network.irc.connection.connected) { + chan.pushMessage(this, new Msg({ + type: Msg.Type.ERROR, + text: "You are already connected." + })); + return; + } + + network.irc.connection.connect(); + return; }