diff --git a/src/commands/live.ts b/src/commands/live.ts index 195bd8b..047773b 100644 --- a/src/commands/live.ts +++ b/src/commands/live.ts @@ -71,7 +71,7 @@ export function stringifyActions( text += ": " } - text += stringify(action.message, { spaces: true }) + text += stringify(action.message!, { spaces: true }) simpleChat.push(text) break diff --git a/src/lib/history.ts b/src/lib/history.ts index 4b9e1d2..25c3a46 100644 --- a/src/lib/history.ts +++ b/src/lib/history.ts @@ -21,7 +21,7 @@ export class ChatHistory { cid: action.authorChannelId, oid, name: action.authorName, - msg: stringify(action.message), + msg: stringify(action.message!), } } insert(action: AddChatItemAction, oid: string) { diff --git a/src/lib/printer.ts b/src/lib/printer.ts index d2d7b67..04d3b39 100644 --- a/src/lib/printer.ts +++ b/src/lib/printer.ts @@ -54,7 +54,7 @@ export function printData({ if (chatCount < maxChats) { log( chalk.gray(`${action.authorChannelId} ${action.authorName}:`), - stringify(action.message) + stringify(action.message!) ) chatCount += 1 } @@ -110,6 +110,26 @@ export function printData({ ) break } + case "membershipGiftPurchaseAction": { + log( + chalk.green( + `[membership gift purchase] ${action.authorName} (${ + action.membership.status + } ${action.membership.since ?? ""}) gifted ${ + action.amount + } memberships for ${action.channelName}` + ) + ) + break + } + case "membershipGiftRedemptionAction": { + log( + chalk.green( + `[membership gift redemption] ${action.authorName} was gifted a membership by ${action.senderName}` + ) + ) + break + } case "addPlaceholderItemAction": { const id = action.id const target = history.findOne(id)?.msg @@ -197,7 +217,23 @@ ${action.authorName}: ${stringify(action.message)} break } case "addViewerEngagementMessageAction": { - log(chalk.cyan(`[${action.messageType}] ${stringify(action.message)}`)) + log(chalk.cyan(`[engagement] ${stringify(action.message)}`)) + break + } + case "addPollResultAction": { + log( + chalk.cyan( + `[poll result] Q. ${ + action.question ? stringify(action.question) : "" + } +${action.choices + .map( + (choice, i) => + `${i + 1}. ${stringify(choice.text)} (${choice.votePercentage})` + ) + .join("\n")}` + ) + ) break } case "modeChangeAction": {