From ced2f1a2f9279ce71be460d9310f9639594c17ee Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Mon, 2 Sep 2024 16:38:00 -0400 Subject: [PATCH] Add helper functions to ChannelList --- src/channel/ChannelList.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/channel/ChannelList.ts b/src/channel/ChannelList.ts index dd1c36c..bd2c9b5 100644 --- a/src/channel/ChannelList.ts +++ b/src/channel/ChannelList.ts @@ -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); }