format
This commit is contained in:
parent
5af8dddcc7
commit
7d11bf8adb
@ -213,7 +213,8 @@ export const twitchPlugin: ChannelPlugin<TwitchAccountConfig> = {
|
|||||||
}): ChannelAccountSnapshot => {
|
}): ChannelAccountSnapshot => {
|
||||||
const accountMap = cfg.channels?.twitch?.accounts ?? {};
|
const accountMap = cfg.channels?.twitch?.accounts ?? {};
|
||||||
const resolvedAccountId =
|
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 {
|
return {
|
||||||
accountId: DEFAULT_ACCOUNT_ID,
|
accountId: DEFAULT_ACCOUNT_ID,
|
||||||
enabled: account?.enabled !== false,
|
enabled: account?.enabled !== false,
|
||||||
|
|||||||
@ -230,7 +230,10 @@ export class TwitchClientManager {
|
|||||||
* Set a message handler for an account
|
* Set a message handler for an account
|
||||||
* @returns A function that removes the handler when called
|
* @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);
|
const key = this.getAccountKey(account);
|
||||||
this.messageHandlers.set(key, handler);
|
this.messageHandlers.set(key, handler);
|
||||||
return () => {
|
return () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user