Merge pull request #1933 from RockyTV/rockytv

Show channel name on channel-related errors
This commit is contained in:
Al McKinlay 2018-02-13 10:03:20 +00:00 committed by GitHub
commit 865e5bb41b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,10 +6,18 @@ module.exports = function(irc, network) {
const client = this; const client = this;
irc.on("irc error", function(data) { irc.on("irc error", function(data) {
let text = data.error; let text = "";
if (data.reason) { if (data.channel) {
text = data.reason + " (" + text + ")"; text = `${data.channel}: `;
}
if (data.error === "user_on_channel") {
text += `User (${data.nick}) is already on channel`;
} else if (data.reason) {
text += `${data.reason} (${data.error})`;
} else {
text += data.error;
} }
const lobby = network.channels[0]; const lobby = network.channels[0];