This commit is contained in:
jaydenfyi 2026-01-25 10:42:15 +08:00
parent 5af8dddcc7
commit 7d11bf8adb
2 changed files with 6 additions and 2 deletions

View File

@ -213,7 +213,8 @@ export const twitchPlugin: ChannelPlugin<TwitchAccountConfig> = {
}): ChannelAccountSnapshot => {
const accountMap = cfg.channels?.twitch?.accounts ?? {};
const resolvedAccountId =
Object.entries(accountMap).find(([, value]) => value === account)?.[0] ?? DEFAULT_ACCOUNT_ID;
Object.entries(accountMap).find(([, value]) => value === account)?.[0] ??
DEFAULT_ACCOUNT_ID;
return {
accountId: DEFAULT_ACCOUNT_ID,
enabled: account?.enabled !== false,

View File

@ -230,7 +230,10 @@ export class TwitchClientManager {
* Set a message handler for an account
* @returns A function that removes the handler when called
*/
onMessage(account: TwitchAccountConfig, handler: (message: TwitchChatMessage) => void): () => void {
onMessage(
account: TwitchAccountConfig,
handler: (message: TwitchChatMessage) => void,
): () => void {
const key = this.getAccountKey(account);
this.messageHandlers.set(key, handler);
return () => {