fix channel resolver issues with plain name

This commit is contained in:
Erik 2021-06-09 18:11:39 +03:00
parent 06de913e11
commit 65b5938192
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16

View File

@ -531,18 +531,16 @@ class Resolver {
const resolved = []; const resolved = [];
for(const resolveable of resolveables) { for(const resolveable of resolveables) {
const channel = CM.resolve(resolveable); const channel = CM.resolve(resolveable);
if(channel && filter(channel)) { if(channel && filter(channel)) {
resolved.push(channel); resolved.push(channel);
continue; continue;
} }
const name = /^#?([a-z0-9\-_0]*)/iu; const name = /^#?([a-z0-9\-_0]+)/iu;
const id = /^<?#?([0-9]*)>?/iu; const id = /^<?#?([0-9]{17,22})>?/iu;
if (id.test(resolveable)) { if (id.test(resolveable)) {
const match = resolveable.match(id); const match = resolveable.match(id);
const [, ch] = match; const [, ch] = match;
@ -551,7 +549,6 @@ class Resolver {
if (channel && filter(channel)) resolved.push(channel); if (channel && filter(channel)) resolved.push(channel);
} else if (name.test(resolveable)) { } else if (name.test(resolveable)) {
const match = resolveable.match(name); const match = resolveable.match(name);
const ch = match[1].toLowerCase(); const ch = match[1].toLowerCase();