# Bot can send chat messages but not receive them

**URL:** <https://discuss.dev.twitch.com/t/bot-can-send-chat-messages-but-not-receive-them/24522>\
**Category:** Chat and IRC\
**Created:** [March 19, 2020, 10:38pm UTC](https://discuss.dev.twitch.com/t/bot-can-send-chat-messages-but-not-receive-them/24522 "2020-03-19T22:38:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathfreak231](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/mathfreak231/32/8129_2.png) [@mathfreak231](https://discuss.dev.twitch.com/u/mathfreak231)\
**Post date:** [March 19, 2020, 10:38pm UTC](https://discuss.dev.twitch.com/t/bot-can-send-chat-messages-but-not-receive-them/24522/1 "2020-03-19T22:38:57Z")

</div>

Hi. I have a bot connecting to the WebSockets URL. It successfully gets capabilities, logs in, and joins my chat room. It successfully receives the GLOBALUSERSTATE, NAMES, HOSTTARGET, USERSTATE, ROOMSTATE etc. commands. It can even send PRIVMSG commands, which I can see in my browser. However, messages I send in my browser do not appear to my bot as PRIVMSG commands. Here is what the input/output looks like:

```
< CAP REQ :twitch.tv/membership
< CAP REQ :twitch.tv/tags
< CAP REQ :twitch.tv/commands
> :tmi.twitch.tv CAP * ACK :twitch.tv/membership
> :tmi.twitch.tv CAP * ACK :twitch.tv/tags
> :tmi.twitch.tv CAP * ACK :twitch.tv/commands
< PASS oauth:REDACTED
< NICK mathbot231
> :tmi.twitch.tv 001 mathbot231 :Welcome, GLHF!
> :tmi.twitch.tv 002 mathbot231 :Your host is tmi.twitch.tv
> :tmi.twitch.tv 003 mathbot231 :This server is rather new
> :tmi.twitch.tv 004 mathbot231 :-
> :tmi.twitch.tv 375 mathbot231 :-
> :tmi.twitch.tv 372 mathbot231 :You are in a maze of twisty passages, all alike.
> :tmi.twitch.tv 376 mathbot231 :>
> @badge-info=;badges=;color=#00FF7F;display-name=mathbot231;emote-sets=0;user-id=123087542;user-type= :tmi.twitch.tv GLOBALUSERSTATE
< JOIN mathfreak231
> :mathbot231!mathbot231@mathbot231.tmi.twitch.tv JOIN mathfreak231
> :mathbot231.tmi.twitch.tv 353 mathbot231 = mathfreak231 :mathbot231
> :mathbot231.tmi.twitch.tv 366 mathbot231 mathfreak231 :End of /NAMES list
> :tmi.twitch.tv HOSTTARGET #mathfreak231 :sunshinemocha -
> @msg-id=host_on :tmi.twitch.tv NOTICE #mathfreak231 :Now hosting SunshineMocha.
> @badge-info=;badges=moderator/1;color=#00FF7F;display-name=mathbot231;emote-sets=0;mod=1;subscriber=0;user-type=mod :tmi.twitch.tv USERSTATE #mathfreak231
> @emote-only=0;followers-only=-1;r9k=0;rituals=0;room-id=60349359;slow=0;subs-only=0 :tmi.twitch.tv ROOMSTATE #mathfreak231
> PING :tmi.twitch.tv
< PONG :tmi.twitch.tv
< PRIVMSG #mathfreak231 :Can I send messages?
> @badge-info=;badges=moderator/1;color=#00FF7F;display-name=mathbot231;emote-sets=0;mod=1;subscriber=0;user-type=mod :tmi.twitch.tv USERSTATE #mathfreak231
> PING :tmi.twitch.tv
< PONG :tmi.twitch.tv
< PRIVMSG #mathfreak231 :Can I send messages?
> @badge-info=;badges=moderator/1;color=#00FF7F;display-name=mathbot231;emote-sets=0;mod=1;subscriber=0;user-type=mod :tmi.twitch.tv USERSTATE #mathfreak231

```

The bot itself is run in Python using asyncio and the websockets library. It logs every message it sends and receives. Is there a part of the protocol I’m missing?

---

<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:** [March 19, 2020, 11:36pm UTC](https://discuss.dev.twitch.com/t/bot-can-send-chat-messages-but-not-receive-them/24522/2 "2020-03-19T23:36:48Z")

</div>

After debugging on Discord the issue is

> [@mathfreak231](#):
>
> \< JOIN mathfreak231  
> \> :mathbot231!mathbot231@mathbot231.tmi.twitch.tv JOIN mathfreak231

No `#` in the channel name with the join command

---

<div class="post-metadata">

**Author:** ![mathfreak231](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/mathfreak231/32/8129_2.png) [@mathfreak231](https://discuss.dev.twitch.com/u/mathfreak231)\
**Post date:** [March 20, 2020, 9:53am UTC](https://discuss.dev.twitch.com/t/bot-can-send-chat-messages-but-not-receive-them/24522/3 "2020-03-20T09:53:07Z")

</div>

thank you!

---

<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:** [April 19, 2020, 9:53am UTC](https://discuss.dev.twitch.com/t/bot-can-send-chat-messages-but-not-receive-them/24522/4 "2020-04-19T09:53:13Z")

</div>

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