mirror of
https://github.com/thelounge/thelounge
synced 2024-12-24 11:23:07 +00:00
20 lines
453 B
JavaScript
20 lines
453 B
JavaScript
var Msg = require("../models/msg");
|
|
|
|
module.exports = function(slate, network) {
|
|
var client = this;
|
|
slate.on("errors", function(data) {
|
|
client.emit("msg", {
|
|
msg: new Msg({
|
|
type: "error",
|
|
from: "-!-",
|
|
text: data.message,
|
|
}),
|
|
});
|
|
if (!network.connected) {
|
|
if (data.cmd == "ERR_NICKNAMEINUSE") {
|
|
var random = client.nick + Math.floor(10 + (Math.random() * 89));
|
|
slate.nick(random);
|
|
}
|
|
}
|
|
});
|
|
};
|