Giter Club home page Giter Club logo

dank-twitch-irc's Issues

PSA: If you're on node `20.0.0` and above, and want to use this library with `client.configuration.connection.secure === true`, use the argument `--no-network-family-autoselection`

Connecting over ws is unaffected
This is relatively rare now, but eventually, you'll get the following error:

node:internal/assert:14
    throw new ERR_INTERNAL_ASSERTION(message);
    ^
NotSpecified: (:) [], RemoteException
Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
NotSpecified: (:) [], RemoteException
    at new NodeError (node:internal/errors:399:5)
    at assert (node:internal/assert:14:11)
    at internalConnectMultiple (node:net:1107:3)
    at Timeout.internalConnectMultipleTimeout (node:net:1638:3)
    at listOnTimeout (node:internal/timers:575:11)
    at process.processTimers (node:internal/timers:514:7) {
  code: 'ERR_INTERNAL_ASSERTION'
}
NotSpecified: (:) [], RemoteException
Node.js v20.2.0

Ignores parallelConnections config

The bot gets rate limited after joing over 20 channels even with a custom config like:

connectionRateLimits: { parallelConnections: 1, // 1 by default // time to wait after each connection before a new connection can begin releaseTime: 2000, // in milliseconds, 2 seconds by default }

It shouldn't get a rate limit with this settings as on twtich docs https://dev.twitch.tv/docs/irc/

20 authentication attempts per 10 seconds per user.
20 join attempts per 10 seconds per user.

Twitch has a problem showing Bits within IrcMessages

Hello,

First of all nice work keeping this lib updated. I'm happy my previous contribution was useful.

I'm facing an issue at my backend where it has become difficult to identify bits spent on messages.
This is not a bug per se, but I'd like to discuss a strategy to figure this out.
It all seems to work fine when there's a Cheer, but problem is Twitch rolled out a "highlighted message" feature where a user can spend 100 bits to highlight this message. At the json level, there's no info about the bits, but there's data about the message being highlighted. Take a look at the raw json:

{
  "rawSource": "@badge-info=;badges=;color=;display-name=xxxxx;emotes=;first-msg=0;flags=18-24:P.3/S.5;id=xxxx;mod=0;msg-id=highlighted-message;returning-chatter=0;room-id=xxxxx;subscriber=0;tmi-sent-ts=xxxx;turbo=0;user-id=xxxxx;user-type= xxxxxx.tmi.twitch.tv PRIVMSG #xxxx:a message",
  "ircPrefixRaw": "xxxx.tmi.twitch.tv",
  "ircPrefix": {
    "nickname": "xxxxx",
    "username": "xxxxx",
    "hostname": "xxxxx.tmi.twitch.tv"
  },
  "ircCommand": "PRIVMSG",
  "ircParameters": [
    "#xxxx",
    "a message"
  ],
  "ircTags": {
    "badge-info": "",
    "badges": "",
    "color": "",
    "display-name": "xxxxxx",
    "emotes": "",
    "first-ms g": "0",
    "flags": "18-24:P.3/S.5",
    "id": "xxxxx",
    "mod": "0",
    "msg-id": "highlighted-message",
    "return ing-chatter": "0",
    "room-id": "xxxxx",
    "subscriber": "0",
    "tmi-sent-ts": "xxxxx",
    "turbo": "0",
    "user-id": "xxxxx",
    "us er-type": ""
  },
  "channelName": "xxxx",
  "messageText": "a message",
  "isAction": false,
  "senderUsername": "xxxxxx",
  "senderUserID": "xxxxxx",
  "badgeInfo": [],
  "badgeInfoRaw": "",
  "badges": [],
  "badgesRaw": "",
  "colorRaw": "",
  "displayName": "xxxxxx",
  "emotes": [],
  "emotesRaw": "",
  "flags": [
    {
      "startIndex": 18,
      "endIndex": 25,
      "word": "xxxxx",
      "categories": [
        {
          "category": "P",
          "score": 3
        },
        {
          "category": "S",
          "score": 5
        }
      ]
    }
  ],
  "flagsRaw": "18-24:P.3/S.5",
  "messageID": "xxxxxx",
  "isMod": false,
  "isModRaw": "0",
  "channelID": "xxxxx",
  "serverTimestamp": "xxxxxx",
  "serverTimestampRaw": "xxxxx"
}

So there is a "msg-id": "highlighted-message" but that's it.
So, my questions:

  • Should we tackle this "highlight" as some boolean flag at the parsed message?
  • Should we worry about the bits? Other types of messages, like cheers, are working properly to others? I'm having trouble tracking spent bits.

I'm open to work on a PR if we agree it is indeed something worth working on. At this point I'm just parsing the tag/msg-id and doing my own logic.

Parser Improvements

First mention #15 (comment)

  • Remove the branch in decodeValue(), as we do it in parseTags() now. Or just remove decodeValue() altogether, it's not really needed, we can do all the logic in parseTags() (tests will have to be updated, either way).
  • Use the this binding of parseTags() as a constructor function, then instance with new, no need to create an extra object, as it's already a this bounded function.
  • Use the buffer directly, then toString() tags and their properties.
  • Move to a traditional for loop, slice indices instead of using split() (the above checkbox would make this cleaner as it comes with a keys() iterator method).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.