# Host information

**URL:** <https://staging-discuss.dev.twitch.com/t/host-information/17152>\
**Category:** Chat and IRC\
**Created:** [August 15, 2018, 10:54pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152 "2018-08-15T22:54:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 15, 2018, 10:54pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/1 "2018-08-15T22:54:47Z")

</div>

I am looking through the IRC chat doc and don’t see any information on reading in host information (this this for Raids)

```auto
> @badges=turbo/1;color=#9ACD32;display-name=TestChannel;emotes=;id=3d830f12-795c-447d-af3c-ea05e40fbddb;login=testchannel;mod=0;msg-id=raid;msg-param-displayName=TestChannel;msg-param-login=testchannel;msg-param-viewerCount=15;room-id=56379257;subscriber=0;system-msg=15\sraiders\sfrom\sTestChannel\shave\sjoined\n!;tmi-sent-ts=1507246572675;tmi-sent-ts=1507246572675;turbo=1;user-id=123456;user-type= :tmi.twitch.tv USERNOTICE #othertestchannel

```

. Am I just blind and missing or can someone provide me the console data that is sent when a host id done for a channel.

---

<div class="post-metadata">

**Author:** ![3ventic](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://staging-discuss.dev.twitch.com/u/3ventic)\
**Post date:** [August 15, 2018, 11:28pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/2 "2018-08-15T23:28:08Z")

</div>

I think you’re looking for [HOSTTARGET](https://dev.twitch.tv/docs/irc/commands/#hosttarget-twitch-commands)

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 15, 2018, 11:28pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/3 "2018-08-15T23:28:58Z")

</div>

oh, that is the information, ok, thanks. I saw this and didnt know if thats what i was supposed to use or if that was something different. I’m still new, thank you.

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 15, 2018, 11:32pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/4 "2018-08-15T23:32:08Z")

</div>

Host starts message:

```auto
> :tmi.twitch.tv HOSTTARGET #hosting_channel <channel> [<number-of-viewers>]

```

Host stops message:

```auto
> :tmi.twitch.tv HOSTTARGET #hosting_channel :- [<number-of-viewers>]

```

what does the start and stop message mean? also, #hosting\_channel does that mean the target channel being hosted, or is that the channel initiating the host?

---

<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:** [August 16, 2018, 12:27am UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/5 "2018-08-16T00:27:26Z")

</div>

The channel initiating the host.

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 20, 2018, 11:15pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/6 "2018-08-20T23:15:45Z")

</div>

ok i am trying to work with this, and I cannot get it to work at all. Is :tmi.twitch.tv HOSTTARGET #hosting\_channel \<channel\> [\<number-of-viewers\>] the entire message or do I need extra things like an oauth token?

I keep getting Uncaught SyntaxError: Unexpected identifier

---

<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:** [August 20, 2018, 11:49pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/7 "2018-08-20T23:49:39Z")

</div>

Please post the code you are using to connect to chat and listen for commands.

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 20, 2018, 11:50pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/8 "2018-08-20T23:50:59Z")

</div>

this is the code i am using to listen for host calls

hostTrigger: function (data) {

```
  // if (data.includes("PRIV")) {
        
        var parts = data.split(' ');
        var vars = {};

        if(parts[1] === "HOSTTARGET")
        {
            if(parts[3] === ":-")
            {
                return;
            }

            else{

                var name = parts[2];
                vars.hostName = name;
                
                var quantity = parts[4];
                vars.hostAmount = quantity;
    
                sendVariables(constants.inputNames.HOST_ALERT, vars, "alert");
            }
   
    }
},
```

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 21, 2018, 12:01am UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/9 "2018-08-21T00:01:12Z")

</div>

I am confused on what message is coming in for me to listen for.

Is it: [tmi.twitch.tv](http://tmi.twitch.tv) HOSTTARGET #lantheos :lilrex2015 0

or is it: @msg-id=host\_on :tmi.twitch.tv NOTICE #lantheos :Now hosting Lilrex2015.

and how am I supposed to test it, whenever I put it in the console it returns Uncaught SyntaxError: Unexpected identifier

---

<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:** [August 21, 2018, 8:09am UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/10 "2018-08-21T08:09:39Z")

</div>

> [tmi.twitch.tv](http://tmi.twitch.tv/) HOSTTARGET #lantheos :lilrex2015 0

is default

> @msg-id=host\_on :tmi.twitch.tv NOTICE #lantheos :Now hosting Lilrex2015.

is if you have requested the TAGS capability

But I’d have to dig thru my code/notes to check to be sure, and I don’t bother with the HOST’s too much as the chatter count is only in the broadcasters chat for incoming hosts… And I don’t login as broadcaster ever

Looking at the docs

> **[Sending and Receiving Chat Messages](https://dev.twitch.tv/docs/chat/send-receive-messages)**
>
> Sending and Receiving Chat Messages Sending chat messages Sending chat messages is performed using the Send Chat Message API. You’ll perform this filling in the broadcaster\_id with the chat channel owner’s User ID, and with sender\_id being your bot’s...

Host Start

```auto
> :tmi.twitch.tv HOSTTARGET #hosting_channel <channel> [<number-of-viewers>]

```

Host End

```auto
> :tmi.twitch.tv HOSTTARGET #hosting_channel :- [<number-of-viewers>]

```

With TAGS capability the additional occurs: (or may replace not sure without testing to be sure which I can’t right now)

## msg-id Tags for the NOTICE Commands Capability

| msg-id | Message |
| --- | --- |
| bad\_host\_hosting | This channel is hosting `<channel>` |
| host\_off | Exited host mode. |
| host\_on | Now hosting . |
| hosts\_remaining | There are host commands remaining this half hour. |

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 21, 2018, 2:09pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/11 "2018-08-21T14:09:00Z")

</div>

Hi Barry, I appreciate the response, but I am confused still, what message am I listening for?

When I try and use [tmi.twitch.tv](http://tmi.twitch.tv/) HOSTTARGET #lantheos :lilrex2015 0 I get no response and when I throw a sample line into the debug console all I get back is Uncaught SyntaxError: Unexpected identifier

---

<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:** [August 21, 2018, 3:07pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/12 "2018-08-21T15:07:35Z")

</div>

> [@Lilrex](#):
>
> When I try and use

You are trying to SEND a hosttarget to chat?

Twitch sends HOSTTARGETs as a specicial message (like how a regular message is of type PRIVMSG)

You cannot send a HOSTTARGET, twitch sends a HOSTTARGET

If you want to send a host to change the host on a given channel you just send `.host TARGETCHANNEL` to the channel you want to change the host of.

So if I want to use my bot to change hosts on my channel to cohhcarnage

`BarryCarlyonBot` would send a PRIVMSG of `.host cohhcarnage` to the channel `barrycarlyon`

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 21, 2018, 3:09pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/13 "2018-08-21T15:09:09Z")

</div>

so can you give me an example of what that will look like when i pass it to the console.

Im still really new to programming and JS, so a lot of this is hard for me to wrap my head around.

---

<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:** [August 21, 2018, 3:09pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/14 "2018-08-21T15:09:27Z")

</div>

I don’t understand what you are actually trying to do…

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 21, 2018, 3:11pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/15 "2018-08-21T15:11:22Z")

</div>

I am trying to make an alert trigger when a channel gets a host from another channel.

I have set up subscribers, follows and all the others. But since hosts apparently do not come in the same way

> @badges=turbo/1;color=#9ACD32;display-name=TestChannel;emotes=;id=3d830f12-795c-447d-af3c-ea05e40fbddb;login=testchannel;mod=0;msg-id=raid;msg-param-displayName=TestChannel;msg-param-login=testchannel;msg-param-viewerCount=15;room-id=56379257;subscriber=0;system-msg=15\sraiders\sfrom\sTestChannel\shave\sjoined\n!;tmi-sent-ts=1507246572675;tmi-sent-ts=1507246572675;turbo=1;user-id=123456;user-type= :tmi.twitch.tv USERNOTICE #othertestchannel

```auto

this way, I am having trouble understanding what message I am listening for, and bc of that, I am confused on how I can test to see if I am capturing the right message
```

---

<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:** [August 21, 2018, 3:13pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/16 "2018-08-21T15:13:03Z")

</div>

You want inbound raids or inbound hosts or both?

You’ve asked about hosts and posted an example message about raids. Raids and hosts are two separate slightly connected things…

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 21, 2018, 3:15pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/17 "2018-08-21T15:15:44Z")

</div>

I want hosts, I was using raids to see if I could capture host data the same way. But from the responses I have been getting I guess not.

Ill break it down and hopefully I explain this right (please forgive me)

I want a host alert, I looked over the doc and I see HOSTTARTGET and a chat command , I have no idea which one is which, nor what either one does. I simply want to listen for when a channel hosts me and trigger an alert.

---

<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:** [August 21, 2018, 3:20pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/18 "2018-08-21T15:20:28Z")

</div>

Inbound hosts are undocumented and I don’t have an example payload as I don’t login to chat as the broadcaster **_ever_**

For hosts I poke this API

> [http://tmi.twitch.tv/hosts?include\_logins=1&target=USERID](http://tmi.twitch.tv/hosts?include_logins=1&target=USERID)

or

> [https://api.twitch.tv/kraken/channels/USERID/hosts](https://api.twitch.tv/kraken/channels/USERID/hosts)

---

<div class="post-metadata">

**Author:** ![Lilrex](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/lilrex/32/4782_2.png) [@Lilrex](https://staging-discuss.dev.twitch.com/u/Lilrex)\
**Post date:** [August 21, 2018, 3:21pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/19 "2018-08-21T15:21:54Z")

</div>

> [@BarryCarlyon](#):
>
> I don’t login to chat as the broadcaster _ **ever** _

why?

---

<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:** [August 21, 2018, 3:22pm UTC](https://staging-discuss.dev.twitch.com/t/host-information/17152/20 "2018-08-21T15:22:42Z")

</div>

I’ve never had a broadcaster grant me a chat login scope for their account for security reasons…

[Next page](https://staging-discuss.dev.twitch.com/t/host-information/17152.md?page=2)
