parent
5e1beb5b46
commit
426893077f
@ -361,14 +361,13 @@ $(function() {
|
|||||||
let value = params[key];
|
let value = params[key];
|
||||||
|
|
||||||
if (key === "join") {
|
if (key === "join") {
|
||||||
const channels = value.split(",");
|
value = value.split(",").map((chan) => {
|
||||||
value = channels.map((c) => {
|
if (!chan.match(/^[#&!+]/)) {
|
||||||
if (c.match(/^\w/)) {
|
return `#${chan}`;
|
||||||
return "#" + c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return chan;
|
||||||
}).join(",");
|
}).join(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
// \W searches for non-word characters
|
// \W searches for non-word characters
|
||||||
|
@ -177,7 +177,11 @@ Client.prototype.connect = function(args) {
|
|||||||
channels = args.join
|
channels = args.join
|
||||||
.replace(/,/g, " ")
|
.replace(/,/g, " ")
|
||||||
.split(/\s+/g)
|
.split(/\s+/g)
|
||||||
.map(function(chan) {
|
.map((chan) => {
|
||||||
|
if (!chan.match(/^[#&!+]/)) {
|
||||||
|
chan = `#${chan}`;
|
||||||
|
}
|
||||||
|
|
||||||
return client.createChannel({
|
return client.createChannel({
|
||||||
name: chan,
|
name: chan,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user