Add helper functions to ChannelList

This commit is contained in:
Hri7566 2024-09-02 16:38:00 -04:00
parent 285776602d
commit ced2f1a2f9
1 changed files with 8 additions and 0 deletions

View File

@ -48,6 +48,14 @@ export class ChannelList {
return this.list;
}
public static getChannel(_id: string) {
return this.list.find(ch => ch.getID() === _id);
}
public static getChannelFuzzy(text: string) {
return this.list.find(ch => ch.getID().toLowerCase() == text.toLowerCase());
}
public static getPublicList() {
return this.list.filter(ch => ch.getSetting("visible") == true);
}