mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 04:23:13 +00:00
Merge pull request #1933 from RockyTV/rockytv
Show channel name on channel-related errors
This commit is contained in:
commit
865e5bb41b
1 changed files with 11 additions and 3 deletions
|
@ -6,10 +6,18 @@ module.exports = function(irc, network) {
|
|||
const client = this;
|
||||
|
||||
irc.on("irc error", function(data) {
|
||||
let text = data.error;
|
||||
let text = "";
|
||||
|
||||
if (data.reason) {
|
||||
text = data.reason + " (" + text + ")";
|
||||
if (data.channel) {
|
||||
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];
|
||||
|
|
Loading…
Reference in a new issue