Hey Guys,
we, 99Damage, are a quite big community in Germany and we have about 20 Mods and more than 15 Channels. When a new guy is joining us, we have to login in every account and give him mod-rights. Is there any way to make it faster? It would be nice if bots could grant rights depended on names or user-ids.
A bot cannot grant mod status. The only person who can give mod status is the streamer. A way to make it faster is to merge some accounts. What it does is let multiple people use the account. But the only problem is that only one person can stream on it at a time.
Well, we got sometimes 5-6 guys streaming simultaniously and because of ESL, we have seperate ESL-Channels. I know a Bot canât grant mod status I thought about something like subscribing to our channels. 1 Sub, 20 Channels - so you can group Channels to grant a user mod everywhere.
Do you mean they receive a new stream key when they login, or a new chat oauth token (I donât stream or use xsplit, so Iâm just not completely sure what you mean)? If you go here: http://www.twitch.tv/settings/connections and âTMI Token Genâ isnât listed at the bottom under âOther Connectionsâ, then you likely mean a different kind of token; in which case Iâd go with what Barry is saying. You can make a bot that logs into chat separately with each streamerâs username / token pair, and performs the /mod or /unmod command.
Or if the xsplit wizard is using that application too, this is the link for creating your own application: http://www.twitch.tv/kraken/oauth2/clients/new though it might take a little bit of work to set one up. The application would only need to be created and added once, and I believe you can generate a token that doesnât expire so youâd only need to do that once too, and then save the info in a config file for the bot.
You definitely need a new oAuth Token everytime you log in. It doesnât matter if you login als Bot or as normal User. The stream key keeps the same. Our problem is, you canât generate a oAuth Token by server-script - well, we still donât have an idea how to do it.
TL;DR
There is no possibility for the PHP-Script to log in into api.twitch.tv to get a code, which is nessecary for us to generate the oAuth. Or did I miss something?
Well, there is no way to send the login information via POST, because of Cross-Origin restrictions. There must be a way for the php script to login, take the code, transform zu oAuth-Code - but for 20 channels just by starting the script.
Or you could give me a hint how to login without user interaction. There is no description in the API and noone got a useful answer till now for this problem.
If you want to mod a user in multiple chats you would first have to generate an OAuth token for each account (see this is you want to create your own app or use my generator), store that and then connect to chat with each account and send a command to mod the user:
And this is exactly our problem. Since our casters are login through xsplit with these scopes:
user_read+channel_read+channel_editor+channel_commercial+chat_login
With this login the oauth-token for that account will be invalid.
We need an automated system to get 27 oauth tokens WITHOUT any user interaction or login with account and password.
A user can have multiple oauth tokens, the only limitation is one per application. Therefore, I can have an oauth token for xsplit, an oauth token for nightbot, and a token for âSmatifyâs auto-mod granting applicationâ at the same time with no issues.
You can generate the oauth token as many times as youâd like. As long as that user doesnât log out, they remain logged in with the old oauth token. If you make it retrieve a token during the connection process, this is a non issue.
Again, your problem is application design, not the available apis.
You only need to generate an OAuth token once, then can keep using the same one every time for logging into chat (the token is your password; ex. to login with an IRC bot, you might use âminnifutzi234â as the username and âoauth:m7u1dhf6garrr39xinvwj0gy3fpkwrâ as the password).
The app only needs to be authorized once on each account also, because you can save the authorization code it gives you, and then use it for generating as many OAuth tokens as you need in the future. Then if you so desire, can use it to automatically request a new token each time using PHP (or your language of choice). Though Iâm not sure why youâd want new ones each time, since this is all backend stuff being controlled by you, not through some 3rd party app, and since it greatly simplifies things to just keep using the same token.
Once you have a âchat_loginâ scopeâd OAuth token for each account, the rest can be done solely by chat commands, which means all you need is a small script that logs into each account (either sequentially, or all simultaneously) and sends the raw command PRIVMSG #channelName :/mod moderatorName (or /unmod to unmod).
And back to the TMI Chat OAuth Password Generator app. From what I can find, it sounds like the XSplit setup wizard uses its own app to authorize to your Twitch account (you can know for sure by checking which authorized apps are listed on your Twitch connections settings page), which should leave the TMI Token Gen app currently unused on the streaming accounts. Itâs the app that everyone who uses Chatty or mIRC uses to get their chat login password.
Personally, Iâd recommend just letting the TMI Token Gen app get the OAuth keys for you, then store each accountâs OAuth token in the botâs config file (thatâs how most of us do it; itâs a pointless exercise to do it on your own for one-off projects like these).