# Posting a comment on a live stream

**URL:** <https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463>\
**Category:** API\
**Created:** [December 20, 2022, 11:51am UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463 "2022-12-20T11:51:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvurth000100](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/bvurth000100/32/21158_2.png) [@bvurth000100](https://discuss.dev.twitch.com/u/bvurth000100)\
**Post date:** [December 20, 2022, 11:51am UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463/1 "2022-12-20T11:51:23Z")

</div>

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

Thanks

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [December 20, 2022, 12:07pm UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463/2 "2022-12-20T12:07:15Z")

</div>

To send a message to chat you will need to create an IRC connection, as documented in the [Chat Documentation](https://dev.twitch.tv/docs/irc), 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.

---

<div class="post-metadata">

**Author:** ![bvurth000100](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/bvurth000100/32/21158_2.png) [@bvurth000100](https://discuss.dev.twitch.com/u/bvurth000100)\
**Post date:** [December 20, 2022, 12:15pm UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463/3 "2022-12-20T12:15:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [December 20, 2022, 12:38pm UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463/4 "2022-12-20T12:38:14Z")

</div>

> [@bvurth000100](#):
>
> Is there an option there where the bot sends a message under the user name?

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

---

<div class="post-metadata">

**Author:** ![bvurth000100](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/bvurth000100/32/21158_2.png) [@bvurth000100](https://discuss.dev.twitch.com/u/bvurth000100)\
**Post date:** [December 20, 2022, 12:43pm UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463/5 "2022-12-20T12:43:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [December 20, 2022, 12:47pm UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463/6 "2022-12-20T12:47:32Z")

</div>

> [@bvurth000100](#):
>
> Because I only saw where the bot sends it under the boys name

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

---

<div class="post-metadata">

**Author:** ![bvurth000100](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/bvurth000100/32/21158_2.png) [@bvurth000100](https://discuss.dev.twitch.com/u/bvurth000100)\
**Post date:** [December 20, 2022, 12:53pm UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463/7 "2022-12-20T12:53:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [December 20, 2022, 12:56pm UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463/8 "2022-12-20T12:56:06Z")

</div>

> [@bvurth000100](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [January 19, 2023, 12:56pm UTC](https://discuss.dev.twitch.com/t/posting-a-comment-on-a-live-stream/42463/9 "2023-01-19T12:56:22Z")

</div>

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