How can i change !game and !title (TMİ.js)

Hi,

I’m using tmi js and making my own bot for my channel. I was looking at events and commands. I just want to change stream title and stream game names. But i couldn’t see anything. I’ve checked the documents, but I don’t know how to use it. Can you please help me.

And one more things.
Can i add shortcut to !game.
For example:
When i write !game pubg, then set the game playerunknown’s battlegrounds. Something like that.

Thanks.

You can update a streams game and title through the Twitch API using the Update Channel endpoint, but if you want to do it through a 3rd party library like TMI.js then you’ll have to follow their docs and contact them for support if you need it.

As for shortcuts, you can program commands to do whatever you want.

I checked the document. But I don’t know how to use it. I’ve contacted TMI.js They gave us link to ask them here…

How to make API calls through their library: https://docs.tmijs.org/v1.2.1/Twitch-API.html

The API endpoint you’ll need to use to update game: https://dev.twitch.tv/docs/v5/reference/channels/#update-channel

The docs for how to listen to Chat events: https://docs.tmijs.org/v1.2.1/Events.html#chat
Where it says // Do your stuff. in their example, that’s where you’ll put your code for your commands, such as !game, if you want to be able to use something like ‘pubg’ instead of the games full name, then you’ll have to have to make a list yourself of the games full names (as that’s what the API requires), and the games shorthand that you want to use in your command.

Hi again. I’ve reviewed your sources. But sadly I can’t make Curl request. My code fails or doesn’t work directly. All I want is to be able to add title and! Game commands. I’ve tried all the codes I’ve found. Please help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.