v0.12.0
- BREAKING: Merged
MasterchatAgent
intoMasterchat
- Use
on
andlisten
.iterate
andfetch
are still available for advanced users
- Use
- BREAKING:
new Masterchat(..., {isLive?: boolean})
->new Masterchat(..., {mode?: "live" | "replay"})
- Added type definition for
once
- New
metadata
property - BREAKING: Renamed
MasterchatManager
->StreamPool
- BREAKING: In
StreamPool
event callback,(metadata: Metadata, ...) => {}
->(..., mc: Masterchat) => {}
- i.e.
on("actions", ({ videoId }, actions) => {})
->on("actions", (actions, { videoId }) => {})
- e.g.
on("data", (data, mc) => { if (...) { mc.stop() } })
- i.e.
before:
const mc = new Masterchat(videoId, ...)
try {
for await (const { actions } of mc.iterate()) {
const chats = actions.filter(action => action.type === "addChatItemAction")
...
if (youWant) break;
}
} catch(err) {
...
}
now:
const mc = new Masterchat(videoId, ...)
.on("chats", chats => {
...
if (youWant) mc.stop();
})
.on("error", err => {
...
})
mc.listen()
utils
- BREAKING:
emojiHandler
inrunsToString
now takesYTEmojiRun
instead ofYTEmoji
- Added
textHandler
option torunsToString
- BREAKING:
runsToString
will expand truncated urls (Thanks @stu43005)