The bot joined to the channel “A” and also to other channel “B”. So when I type !dice in channel “A” the bot can response and message is visible. But then I type !dice in channel “B” a message the bot sent is not visible.
Bot can listen for messages, but can send only to the channel which is the account that I used to generate OAuth token.
I didn’t set anything more. So what you suggest? I want to add possibility to send messages to any channel on which a streamer enables the bot in an extension configuration panel (I imagine this in that way: when streamer enables the bot, this makes a http request to my server and then the bot joins to the streamer’s channel).
“Followers-only mode” option is set to off in account B. also account A wasn’t be added as moderator in channel B.
I checked. After adding account A as moderator in channel B the bot can send messages. Is this the only way to do this when the bot goes live? Does every streamer have to add an A account as a moderator for the bot to work on his channel?
I enabled logs. When the bot sends message “in response” following log occurs: Your message was not sent because you are sending messages too quickly.
It only one message since few minutes, so how it can be sent too quickly? Should I wait for some fixed time (e.g. 3 seconds ) with the response?
It works, I just wait 1 second with the response and message is visible on the channel even without moderator status. @BarryCarlyon you helped me with this logging
Also I can’t use the “Extension Chat Message” because I need to send messages from another account than the extension. Also I need to listen users’ messages, because I want to send messages only after there are at least 5 or more other lines of text, I don’t want to spam.
I would be grateful if you can answer more questions:
So since it works, why should I register the bot as an application and also send to verification? May I use it in form as it is now? May I keep the generated OAuth token forever?
I don’t understand exactly what are limits. I read the limits here: https://dev.twitch.tv/docs/irc/guide#command--message-limits
a) “20 authenticate attempts per 10 seconds per user” - when I execute client.connect(); with tmi.js is it just only one authentication attempt?
b) “20 join attempts per 10 seconds per user” - Is my bot treated as a user? I mean when I execute client.join(channel) the rest of the limit is 19? So in case when I need to join to 1000 channels, should I spread these joins in time to not exceed 20 per 10 second per my bot?
c) “20 per 30 seconds Users sending commands or messages to channels in which they do not have Moderator or Operator status” - so after my bot joined to mentioned 1000 channels, and want to send message to each one for every 5 minutes, does it exhaust the limit because it is set per bot or does it not exhaust because it is set per channel?
An Extension is also an application you don’t need a seperate set of keys
oAuth tokens expire, but you’ll be able to use the refresh token to generate a new token.
A bot’s token is only checked at login, so it only needs to be valid at “bot start/connect”
If you have a bad password, bots will generally auto reconnect.
I cannot speak to the specifics of tmi.js as I don’t use tmi.js
Yes
Correct
I believe it’s per channel yeah.
Generally speaking it’s difficult to hit the limits unless you are actually trying to spam
Can use a justinfan/anon login to monitor/count messages if needed, but I’d just send a message every 5 minutes (or whatever time period) regardles of chat lines, to account for new people joining the stream.
Then how do they know the messaging you are sending is related to the extension? If you are using a different name! Using the Extension chat also gives you access to the target channel subscriber emotes without having to “sub the bot” to the channel
Hmm but in case I decide to send messages using original account “A” where the extension is registered but with the bot - not extension chat messages, I should register new bot app, right?