Posting a comment on a live stream

Is there a way to use the API to post a comment on live stream?

Thanks

To send a message to chat you will need to create an IRC connection, as documented in the Chat Documentation, with the appropriate scopes from the user you wish to send the chat message as.

There are no API endpoints for sending messages in chat.

Is there an option there where the bot sends a message under the user name?
Because I only saw where the bot sends it under the boys name

use a token for the bot instead of a token for “the boys”

wdym? i dont want a server per user, is there away that i can use the same code in general? i saw in the docs i need to open an acount for the bot, but i want each time to give him a diffrenet user he’ll use and maybe a few at once

This means the bot/script is logging into chat as the boys name

If you want to login to chat and send to chat as someone else, then you need an oAuth token for that someone else

You have already done the steps to get a token for the boys so just do the same steps but with a different Twitch Account.

All bots on Twitch are regular user accounts.

So for example

  • I own the Clieint: BarryCarlyon's Chat Bots
  • For it to login to Chat and send as CohhilitionBot then Iogout as BarryCarlyon/whoever I’m logged in as, login to Twitch then go thru my oAuth flow as that account to generate a token to use
  • For it to login to Chat and send as SombreBot then Iogout as BarryCarlyon/whoever I’m logged in as, login to Twitch then go thru my oAuth flow as that account to generate a token to use

I own all three user accounts here as I created then for the purpse of myself, or these two example chatbots

i dont want a server per user, is there away that i can use the same code in general? i saw in the docs i need to open an acount for the bot, but i want each time to give him a diffrenet user he’ll use and maybe a few at once.
meaning for example:
i have two user : user A , user B.
once user A connects the bots will start tracking his livestream and when user A send a message in my input the bot will post it on his live stream.
in the mean time user B does the same thing.
and so on, is there a way to do it with one bot acount?

yes.

In this example you’d have three tokens.

  • user A
  • user B
  • the bots

user A/B authing will tell the running process of the bot to connect to user A/B’s chat.

This is how the larger open access bots work (nightbot/fossabot etc)

They ask the streamer to login, to grant additional permission.
Then their backend tells the running bot process to also join the streamers chat.

So far it seems that you have been getting userA’s token and then starting a bot process using userA’s token and joining userA’s chat.
Instead of telling your bot to join userA’s chat.

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