# Bot can't send privat messages

**URL:** <https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059>\
**Category:** Chat and IRC\
**Created:** [October 4, 2018, 8:26pm UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059 "2018-10-04T20:26:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![XLS202](https://avatars.discourse-cdn.com/v4/letter/x/91b2a8/32.png) [@XLS202](https://staging-discuss.dev.twitch.com/u/XLS202)\
**Post date:** [October 4, 2018, 8:26pm UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059/1 "2018-10-04T20:26:08Z")

</div>

Hello,  
I want to write a private message via the IRC chat, but if I send this line for example to the server:

> PRIVMSG #jtv :/w Text.

I get this response:

> [tmi.twitch.tv](http://tmi.twitch.tv) NOTICE #jtv :You don’t have permission to perform that action.

While connecting I send this line to the server:

> CAP REQ :twitch.tv/commands

The response of the validating of my token says that:

> {  
> “client\_id”: “lalala”,  
> “login”: “lalala”,  
> “scopes”: [  
> “channel:moderate”,  
> “chat:edit”,  
> “chat:read”,  
> “whispers:edit”,  
> “whispers:read”  
> ],  
> “user\_id”: “lalala”  
> }

Today I changed my bot from using the old access token that was valid for years to the token that is only valid for a few hours. Before that change everything worked fine.

Any idea how to fix this?

XLS202

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [October 4, 2018, 8:29pm UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059/2 "2018-10-04T20:29:02Z")

</div>

> [@XLS202](#):
>
> PRIVMSG #jtv :/w Text.

Should be:

```
PRIVMSG #jtv :.w someperson Text.

```

Further more send to the channel the bot is rather than #jtv iirc JTV as a send to got closed.

---

<div class="post-metadata">

**Author:** ![XLS202](https://avatars.discourse-cdn.com/v4/letter/x/91b2a8/32.png) [@XLS202](https://staging-discuss.dev.twitch.com/u/XLS202)\
**Post date:** [October 4, 2018, 8:34pm UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059/3 "2018-10-04T20:34:29Z")

</div>

Did this change in the last weeks? Or why did it work before?  
Do you mean it like that?

> PRIVMSG #STREAMER :.w someperson Text.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [October 4, 2018, 8:37pm UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059/4 "2018-10-04T20:37:14Z")

</div>

> [@XLS202](#):
>
> Did this change in the last weeks? Or why did it work before?

No idea. I’ve never used `/w` in a irc bot myself. As `/` should invoke a server command, and `/w` is not a server command

And yes like that.

---

<div class="post-metadata">

**Author:** ![XLS202](https://avatars.discourse-cdn.com/v4/letter/x/91b2a8/32.png) [@XLS202](https://staging-discuss.dev.twitch.com/u/XLS202)\
**Post date:** [October 4, 2018, 8:39pm UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059/5 "2018-10-04T20:39:10Z")

</div>

Thank you 🙂 I will try it tomorrow.

---

<div class="post-metadata">

**Author:** ![george](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/george/32/120_2.png) [@george](https://staging-discuss.dev.twitch.com/u/george)\
**Post date:** [October 4, 2018, 9:58pm UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059/6 "2018-10-04T21:58:03Z")

</div>

It appears you still need the `chat_login` scope to send whispers over IRC.

---

<div class="post-metadata">

**Author:** ![XLS202](https://avatars.discourse-cdn.com/v4/letter/x/91b2a8/32.png) [@XLS202](https://staging-discuss.dev.twitch.com/u/XLS202)\
**Post date:** [October 4, 2018, 11:50pm UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059/7 "2018-10-04T23:50:35Z")

</div>

I didnt try it now, but in the docs is written:

> (Deprecated — cannot be requested by new clients.)  
> Log into chat and send messages.

Is there any way to get it nevertheless?

---

<div class="post-metadata">

**Author:** ![george](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/george/32/120_2.png) [@george](https://staging-discuss.dev.twitch.com/u/george)\
**Post date:** [October 5, 2018, 12:03am UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059/8 "2018-10-05T00:03:20Z")

</div>

Use a client ID created earlier than a few weeks ago or wait for Twitch to fix the issue.

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [November 4, 2018, 12:06am UTC](https://staging-discuss.dev.twitch.com/t/bot-cant-send-privat-messages/18059/9 "2018-11-04T00:06:56Z")

</div>

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