instafluff / ComfyJS

Comfiest Twitch Chat Library for JavaScript | NodeJS + Browser Support
MIT License
405 stars 44 forks source link

Comfyjs.Say() 20 times at once #57

Closed i4Nihon closed 10 months ago

i4Nihon commented 10 months ago

Comfyjs.Say() is executing 20 times at once eaven should do it once, and on different channel is saying nothing here is some code


      const split = message.split(" ")
      switch (split[0].toLowerCase()) {
        case "add":
          if (queueArray.includes(split[1])) {
            ComfyJS.Say(`Nick '${split[1]}' znajduje się już na stronie`, extra.channel)

          } else {
            queueArray.push(`${split[1]}`)
            const data = `${queueArray.join("<br>")}`
            io.emit('updateData', data);
            ComfyJS.Say(`Dodano nick '${split[1]}'`, extra.channel)
          }
          break;
        case "del":
          let a;
          queueArray.every((elem, idx) => {
            if (elem === split[1]) {
              queueArray.splice(idx, 1)
              ComfyJS.Say(`Usunięto nick '${split[1]}' z kolejki`, extra.channel)
              a = 1
              return false
            }
            else {
              a = 0
              return true
            }
          })```
i4Nihon commented 10 months ago

I guess its because onCommands is triggered to many times, and I'm always getting error

 error: msg_banned
i4Nihon commented 10 months ago

Problem solved, I guess it was docker problem