# Sending Whispers with Python / socket module

**URL:** <https://discuss.dev.twitch.com/t/sending-whispers-with-python-socket-module/33517>\
**Category:** Chat and IRC\
**Created:** [September 15, 2021, 4:02am UTC](https://discuss.dev.twitch.com/t/sending-whispers-with-python-socket-module/33517 "2021-09-15T04:02:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [September 15, 2021, 9:11am UTC](https://discuss.dev.twitch.com/t/sending-whispers-with-python-socket-module/33517/2 "2021-09-15T09:11:14Z")

</div>

> [@The\_Combat\_Cactus](#):
>
> f’PRIVMSG jtv :/w USERNAME Test From Bot\r\n’.encode(‘utf-8’))

For start you omittied the `#` at the start of the room name. And you should be operating in a room that you are in.

An outbound whisper has the format:

```
PRIVMSG #roomnane :.w targetuser words that are to be sent

```

I prefer the `.` notification of chat commands but both `.w` and `/w` are valid, some IRC Lib’s are known to grab the `/` and reprocess it as a server command, but you seem to be lib less, so this shouldn’t be an issue.

> [@The\_Combat\_Cactus](#):
>
> I’ve gone through all the previous posts about it. Most of them are 2+ years old and I’m thinking that there might just be another way to do it now / 100% just doesn’t work.

You mileage will vary with Whispers. The older post talk about the semantics.

But the newer posts talk about deliverbility problems:

May: [Whisper doesn't work. Please](https://discuss.dev.twitch.com/t/whisper-doesnt-work-please/31524)  
June: [An update for the delayed bot verification request process - #25 by Dist](https://discuss.dev.twitch.com/t/an-update-for-the-delayed-bot-verification-request-process/32325/25)  
June: [Send whispers with GMS2 - #7](https://discuss.dev.twitch.com/t/send-whispers-with-gms2/32349/7)  
June: [How to reply to whispers with bot - #5](https://discuss.dev.twitch.com/t/how-to-reply-to-whispers-with-bot/32080/5)

They are just not desgined to be used by bots and there are generally better ways to work privately with users, third party portals, extensions etc.

Whispers have deliverability problems for bots. And should be avoided if you want reliabilty.

Generally speaking you will have better luck repling to a whisper as this should of open a conversation whisper. And as per the old freenode rule: A bot should reply in the same medium as it was triggered.

So if it was triggered by chat it replies in chat, if it was triggered in a whisper it replies via whisper.

---

_[View the full topic](https://discuss.dev.twitch.com/t/sending-whispers-with-python-socket-module/33517)._
