# Hosted notification

**URL:** <https://staging-discuss.dev.twitch.com/t/hosted-notification/16939>\
**Category:** API\
**Created:** [August 3, 2018, 6:27pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939 "2018-08-03T18:27:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azazael13](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@Azazael13](https://staging-discuss.dev.twitch.com/u/Azazael13)\
**Post date:** [August 3, 2018, 6:27pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/1 "2018-08-03T18:27:05Z")

</div>

I have been trying to figure out how to get my bot to give a chat message when a channel is hosted. I know it is possible since other bots like Nightbot are doing it, but I can’t figure out how they are getting the information. Is there an API call I am missing or a usernotice?

---

<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 4, 2018, 10:30am UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/2 "2018-08-04T10:30:43Z")

</div>

It is as passed a as NOTICE but _ONLY_ to the broadcasters chat. (I do not have a example of this message to hand)

There are also a number of undocumentedish end points kicking about

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

---

<div class="post-metadata">

**Author:** ![Hugo](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/hugo/32/2386_2.png) [@Hugo](https://staging-discuss.dev.twitch.com/u/Hugo)\
**Post date:** [August 4, 2018, 1:58pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/3 "2018-08-04T13:58:21Z")

</div>

could it be made global to users, or something? I don’t like the idea of having the bot AND the broadcaster account connected just to catch “you have been hosted” events.

---

<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 4, 2018, 2:09pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/4 "2018-08-04T14:09:37Z")

</div>

Use the API end point instead of listening on chat.

It’s been asked for but theres been no movement on it

---

<div class="post-metadata">

**Author:** ![Azazael13](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@Azazael13](https://staging-discuss.dev.twitch.com/u/Azazael13)\
**Post date:** [August 4, 2018, 5:13pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/5 "2018-08-04T17:13:47Z")

</div>

so I need to call that endpoint for every active channel every minute? That just seems like a bad idea. I know there are other bots (again nightbot, moobot) that post the notifications. I know they can do what ever with the endpoints since they are all verified, but the rest of us just have hope we don’t get throttled?

---

<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 4, 2018, 5:18pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/6 "2018-08-04T17:18:22Z")

</div>

> [@Azazael13](#):
>
> so I need to call that endpoint for every active channel every minute? That just seems like a bad idea. I know there are other bots (again nightbot, moobot) that post the notifications. I know they can do what ever with the endpoints since they are all verified, but the rest of us just have hope we don’t get throttled?

Um, thats not true. A verified bot doesn’t have a better Kraken API rate limit.

kraken doesn’t have a rate limit, other than “please don’t be a dick” and pinging the end point once per minute is fine, as you gotta take into account caching (stuff may not appear on the API for ~3 minutes)

The bots in question ping the API end point just like the rest of us. Or we use a chat\_login for the broadcaster, (in the case of custom/secure/safe bots)

---

<div class="post-metadata">

**Author:** ![Azazael13](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@Azazael13](https://staging-discuss.dev.twitch.com/u/Azazael13)\
**Post date:** [August 4, 2018, 5:21pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/7 "2018-08-04T17:21:41Z")

</div>

I was told at one point those two bots got special treatment because of how big they were, if that isn’t the case then that is fine.

I just assumed Kraken had a rate limit since the new api does.

---

<div class="post-metadata">

**Author:** ![TheElm](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/theelm/32/2911_2.png) [@TheElm](https://staging-discuss.dev.twitch.com/u/TheElm)\
**Post date:** [August 4, 2018, 8:58pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/8 "2018-08-04T20:58:48Z")

</div>

There are indeed “several bots” that get “special treatment”\*.

\*By “special treatment”: They are very large programs [that need a higher rate limit because of how many channels they manage (Which any developer can request to get as well)](https://dev.twitch.tv/limit-increase). Whereas a small bot does not need to retrieve their channel information twice every second.

From my experience I believe that you don’t need to be logged into the _broadcaster_ and _chat bot_ account to receive the _HOST_ notices in chat. Only that these chat messages get sent to the _person doing the hosting_ and not the chat of the _hostee_. (I could be mistaken, but my bot doesn’t log in as the broadcaster and I recall seeing these notices)

So if you’re wanted to know when your channel _hosts somebody_ and not _when somebody else hosts you_ then simply refer [to the following NOTICE documentation](https://dev.twitch.tv/docs/irc/commands/#hosttarget-twitch-commands).

.

**Host starts:**

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

```

**Host ends:**

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

---

<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 5, 2018, 12:03pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/9 "2018-08-05T12:03:18Z")

</div>

> [@TheElm](#):
>
> \*By “special treatment”: They are very large programs [that need a higher rate limit because of how many channels they manage (Which any developer can request to get as well)](https://dev.twitch.tv/limit-increase). Whereas a small bot does not need to retrieve their channel information twice every second.

That wasn’t the “special treatment” OP was referring to. It was rumoured for a while that the larger bot creators had alternative access to certain things. Before rate limits or helix even existed

> [@TheElm](#):
>
> From my experience I believe that you don’t need to be logged into the _broadcaster_ and _chat bot_ account to receive the _HOST_ notices in chat. Only that these chat messages get sent to the _person doing the hosting_ and not the chat of the _hostee_ . (I could be mistaken, but my bot doesn’t log in as the broadcaster and I recall seeing these notices)

I said as much in my first reply on the thread.

> [@TheElm](#):
>
> So if you’re wanted to know when your channel _hosts somebody_ and not _when somebody else hosts you_ then simply refer [to the following NOTICE documentation](https://dev.twitch.tv/docs/irc/commands/#hosttarget-twitch-commands).

OP is a little unclear but by since they refer to the other bots, I assume they are referring to inbound hosts to a channel, as outbound hosts are clearly documented in the docs that I’m sure everyone has read.

---

<div class="post-metadata">

**Author:** ![Azazael13](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@Azazael13](https://staging-discuss.dev.twitch.com/u/Azazael13)\
**Post date:** [August 5, 2018, 1:25pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/10 "2018-08-05T13:25:42Z")

</div>

Just to be 100% clear, I know I can detect when a channel my bot is in hosts another channel. I have had lots of trouble figuring out when a channel my bot is in is hosted by another channel. The old Kraken link posted above is a start, but I was really hoping there would be a pubsub or usernotice for it that I just wasn’t aware of.

---

<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:** [September 4, 2018, 1:25pm UTC](https://staging-discuss.dev.twitch.com/t/hosted-notification/16939/11 "2018-09-04T13:25:45Z")

</div>

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