Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
uetchy committed Sep 17, 2021
1 parent 0b60fe3 commit e4890b5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# MasterChat CLI

[![npm](https://badgen.net/npm/v/masterchat-cli)](https://npmjs.org/package/masterchat-cli)
[![npm: total downloads](https://badgen.net/npm/dt/masterchat-cli)](https://npmjs.org/package/masterchat-cli)

See YouTube Live Chat through flexible filtering engine. For GUI version, see [Komet](https://github.com/holodata/komet).

## Install
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.7.3",
"author": "Yasuaki Uechi <[email protected]> (https://uechi.io/)",
"scripts": {
"build": "tsc",
"build": "tsc && shx chmod +x ./lib/cli.js",
"clean": "shx rm -rf lib",
"dev": "tsc -w",
"format": "pretty-quick --staged",
Expand All @@ -22,21 +22,21 @@
],
"dependencies": {
"epicfail": "^3.0.0",
"masterchat": "^0.9.0",
"masterchat": "^0.11.0",
"vm2": "^3.9.3"
},
"devDependencies": {
"@types/jest": "^27.0.1",
"@types/node": "^16.9.0",
"@types/node": "^16.9.2",
"execa": "^5.1.1",
"husky": "^7.0.2",
"jest": "^27.1.1",
"prettier": "^2.4.0",
"jest": "^27.2.0",
"prettier": "^2.4.1",
"pretty-quick": "^3.1.1",
"shx": "^0.3.3",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.1",
"typescript": "^4.4.2"
"typescript": "^4.4.3"
},
"homepage": "https://github.com/holodata/masterchat-cli",
"repository": {
Expand Down
13 changes: 8 additions & 5 deletions src/commands/liveChat.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from "chalk";
import { Action, Masterchat, normalizeVideoId, runsToString } from "masterchat";
import { Action, Masterchat, toVideoId, runsToString } from "masterchat";
import fs from "node:fs";
import { VM, VMScript } from "vm2";

Expand All @@ -23,7 +23,7 @@ export function stringifyActions(
}

text += action.rawMessage
? runsToString(action.rawMessage)
? runsToString(action.rawMessage, { spaces: true })
: "<empty message>";

text += ` (${action.superchat.amount} ${action.superchat.currency})`;
Expand Down Expand Up @@ -59,7 +59,7 @@ export function stringifyActions(
text += ": ";
}

text += runsToString(action.rawMessage);
text += runsToString(action.rawMessage, { spaces: true });

simpleChat.push(text);
break;
Expand Down Expand Up @@ -110,7 +110,10 @@ export async function inspectChat(argv: any) {
process.exit(0);
});

const videoId: string = normalizeVideoId(argv.video);
const videoId: string | undefined = toVideoId(argv.video);
if (!videoId) {
throw new Error(`Invalid videoId: ${argv.video}`);
}
const verbose: boolean = argv.verbose;
const showModeration: boolean = argv.mod;
const showAuthor: boolean = argv.author;
Expand Down Expand Up @@ -167,7 +170,7 @@ export async function inspectChat(argv: any) {
isSuperchat: action.type === "addSuperChatItemAction",
message:
"rawMessage" in action && action.rawMessage
? runsToString(action.rawMessage)
? runsToString(action.rawMessage, { spaces: true })
: "",
};
return filter(filterContext);
Expand Down

0 comments on commit e4890b5

Please sign in to comment.