Skip to content

v0.12.0

Compare
Choose a tag to compare
@uetchy uetchy released this 25 Sep 13:55
· 113 commits to master since this release
  • BREAKING: Merged MasterchatAgent into Masterchat
    • Use on and listen. iterate and fetch are still available for advanced users
  • 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() } })

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 in runsToString now takes YTEmojiRun instead of YTEmoji
  • Added textHandler option to runsToString
  • BREAKING: runsToString will expand truncated urls (Thanks @stu43005)