Skip to content

Commit

Permalink
Skip error actions
Browse files Browse the repository at this point in the history
  • Loading branch information
HitomaruKonpaku committed Dec 10, 2022
1 parent e2e969c commit f663e17
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/masterchat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,15 @@ export class Masterchat extends EventEmitter {
}

const actions = rawActions
.map(parseAction)
.filter((a): a is Action => a !== undefined);
.map((action) => {
try {
return parseAction(action);
} catch (error: any) {
this.log("parseAction", error.message, { action });
return null;
}
})
.filter((a): a is Action => !!a);

const chat: ChatResponse = {
actions,
Expand Down

0 comments on commit f663e17

Please sign in to comment.