# mIRC Bot sends chat messages in the program but not in Twitch Chat

**URL:** <https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192>\
**Category:** Chat and IRC\
**Created:** [May 19, 2016, 6:12am UTC](https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192 "2016-05-19T06:12:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skii7niX](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/skii7nix/32/1724_2.png) [@Skii7niX](https://discuss.dev.twitch.com/u/Skii7niX)\
**Post date:** [May 19, 2016, 6:12am UTC](https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192/1 "2016-05-19T06:12:04Z")

</div>

When I use a command or something is typed that is set to trigger a command, the bot outputs in the program (mIRC) but not in the Twitch chat. I have tried researching, but haven’t found an answer or anybody who has had the same exact problem.

Example:  
(Program) [http://prntscr.com/b5ssga](http://prntscr.com/b5ssga)  
(Twitch Chat) [http://prntscr.com/b5ssjj](http://prntscr.com/b5ssjj)

I also had a bot output a message when somebody subscribed, and I used “describe” and also tried “msg”. It ended up showing up in the [twitch.tv](http://twitch.tv) window instead of the chat window. Here is my code:

```
on 1:TEXT:*subscribed*:#a_jaxx:{
  if ( $nick == twitchnotify ) && ($istok($1-,subscribed to,32)) halt
  elseif ($nick == twitchnotify) && ( $4 == $null ) { msg $chan jaxxSub jaxxHearts jaxxSub jaxxSub jaxxHearts jaxxSub jaxxSub jaxxHearts jaxxSub jaxxSub jaxxHearts jaxxSub jaxxHearts jaxxSub jaxxHearts jaxxSub jaxxHearts jaxxSub THANKS FOR SUBBING $1! YOU ARE AMAZING!! }
  elseif ($nick == twitchnotify) && ( $4 isnum ) { msg $chan jaxxSub jaxxHearts jaxxSub jaxxSub jaxxHearts jaxxSub jaxxSub jaxxHearts jaxxSub jaxxSub jaxxHearts jaxxSub jaxxHearts jaxxSub jaxxHearts jaxxSub jaxxHearts jaxxSub <3 YO! $1, THANKS FOR SUBBING FOR $4 MONTHS IN A ROW! }
}

on 1:TEXT:*slap me*:#a_jaxx:{
  { msg $chan *SLAP* I slapped you! }
}

on *:TEXT:!test:#: { msg $chan Your bot is working! }
```

---

<div class="post-metadata">

**Author:** ![DallasNChains](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dallasnchains/32/1608_2.png) [@DallasNChains](https://discuss.dev.twitch.com/u/DallasNChains)\
**Post date:** [May 19, 2016, 5:08pm UTC](https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192/2 "2016-05-19T17:08:46Z")

</div>

I don’t have a lot of background in making bots with mIRC. I do know that mIRC sometimes doesn’t pick up changes to your commands file without a restart. Save the file and restart mIRC to make sure the changes are being applied.

Do all commands fail? And are you connected using an OAuth token with the correct scope?

---

<div class="post-metadata">

**Author:** ![xangold](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/xangold/32/527_2.png) [@xangold](https://discuss.dev.twitch.com/u/xangold)\
**Post date:** [May 19, 2016, 5:40pm UTC](https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192/3 "2016-05-19T17:40:32Z")

</div>

I forget exactly what the user level 1 is. I’d make sure that it first works with this:

```
on *:text:*:#a_jaxx: {

```

Small thing, that you will later appreciate is to not format your code with { foobar }, and instead put your braces at the end of the top line, and below your code, instead of wrapping how you have it now. [https://en.wikipedia.org/wiki/Programming\_style](https://en.wikipedia.org/wiki/Programming_style)

I also remember vaguely that you can type `/window @debug` in order to open a debug window. This should print out the raw IRC data for further inspection. Can you paste it here?

---

<div class="post-metadata">

**Author:** ![tduva](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/tduva/32/392_2.png) [@tduva](https://discuss.dev.twitch.com/u/tduva)\
**Post date:** [May 19, 2016, 11:20pm UTC](https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192/4 "2016-05-19T23:20:42Z")

</div>

I was gonna say make sure the channel name you join is in all-lowercase, but now I can’t even receive messages typed in Webchat when I do that, so I’m not sure how your bot would have tried to respond in the first place. Still something to look out for though.

---

<div class="post-metadata">

**Author:** ![Skii7niX](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/skii7nix/32/1724_2.png) [@Skii7niX](https://discuss.dev.twitch.com/u/Skii7niX)\
**Post date:** [May 20, 2016, 9:10pm UTC](https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192/5 "2016-05-20T21:10:13Z")

</div>

Yes, and yes. I restarted mIRC several times and it made no difference. For some reason though, restarting my laptop made it work.

---

<div class="post-metadata">

**Author:** ![Skii7niX](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/skii7nix/32/1724_2.png) [@Skii7niX](https://discuss.dev.twitch.com/u/Skii7niX)\
**Post date:** [May 20, 2016, 9:12pm UTC](https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192/6 "2016-05-20T21:12:32Z")

</div>

> **[Screenshot](https://prnt.sc/b6hem9)**
>
> Captured with Lightshot

Using mIRC, is causes problems if you break the command and continue it on the next line, so to make it work best, I kept it all on one line. When I usually code, I break it up more.

---

<div class="post-metadata">

**Author:** ![MattiSony](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/mattisony/32/1558_2.png) [@MattiSony](https://discuss.dev.twitch.com/u/MattiSony)\
**Post date:** [May 20, 2016, 9:57pm UTC](https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192/7 "2016-05-20T21:57:05Z")

</div>

Can you change the test command to this  
`on *:TEXT:!test:#: { timer 1 2 msg $chan Your bot is working! }`  
and see if that works? Also make sure you’re joining the channel with lower cased channelname.

---

<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:** [June 19, 2016, 9:57pm UTC](https://discuss.dev.twitch.com/t/mirc-bot-sends-chat-messages-in-the-program-but-not-in-twitch-chat/6192/8 "2016-06-19T21:57:06Z")

</div>

Closed on June 19, 2016, 9:57pm UTC

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