This is a simple hostbot that will automatically host a list of given channels, sorted by their priorities, when they go online. It will keep hosting a channel until it goes offline and then re-host a new channel afterwards.
- Continuous hosting of channels per the priority list. Once a channel goes offline, it will automatically attempt to find a new live channel to host following the priorities in the priority list.
- Due to the Twitch API sometimes being a bit slow on updating "live" status of a stream, the automatic rehost will trigger 15 seconds after a host has ended due to the channel going offline.
- Priority levels go from highest number to lowest. If no priority is specified when a channel is added, then the priority will be 0.
- Each priority level can contain either one or multiple channels.
- If the highest priority level with live channels have multiple channels currently live, it will pick a random live channel from the specific priority level.
Commands, by default, all require the users that wish to use it to be an 'admin'. Admins are specified in the config.admins
array.
The format of commands will be <required parameter>
and [optional parameter]
. The rest are static keywords.
!addstreamer <channel name> [priority]
- Adds a streamer to the list of channels to be hosted.[priority]
can be any number, but if it's not specified it defaults to 0.- If a streamer is already added, this will update their
priority
.
- If a streamer is already added, this will update their
!removestreamer <channel name>
- Removes a streamer from the list of channels to be hosted.!listpriorities <priority>
- Lists what channels are listed under<priority>
, if any.!host
- Hosts a new channel by sorting through the priorities, regardless if any channel is being hosted or not.!rehost
- An alias of!host
.!unhost
- Unhosts the current channel.- NOTE: Due to the way the bot detects unhosting of channels, this will automatically trigger a rehost if a prioritized channel is live. This is only really useful if you've removed a streamer from the priority list and wish to unhost when no one else is live on the priority list.
!status
- Replies with who is currently being hosted, if anyone.!quit
- WARNING: This will quit the application completely and requires it to be restarted for commands/hosting to function if used.
- Install node and npm
- Install dependencies using
npm install
in the directory of the project. - Rename
config.sample.js
toconfig.js
and edit the info ofconfig.js
- Generally speaking, you only need to modify
username
&password
insideconfig.tmi
, as well aschannels
for auto-connecting channels. - If the bot doesn't seem to receive/respond to messages, make sure you're on the right chat cluster.
clientId
requires a Twitch developer application - As of September 2016, the client ID is now required for all API requests, which also affects this.
- Generally speaking, you only need to modify
- Launch bot with
node app.js
- The channel used for hosting is always the first index in
config.tmi.channels
. This way you can specify which channel to host with, but still allow use of commands in different channels.- If no channels are specified in
config.tmi.channels
then it will default back to the username. This channel will also be automatically joined on startup if no other channels are specified inconfig.tmi.channels
.
- If no channels are specified in
- Hotfix for crash when the bot attempts to check hosts.
- Modified how hosts are retrieved.
- Added workaround for host notifications not properly working.
- Automatic rehosting's delay has been updated from 15 seconds to 120 seconds (2 minutes), as the Twitch API seems extremely slow when it comes to updating at times.
- Automatic rehosting when the channel that was hosted goes offline is now delayed with 15 seconds, due to the fact the Twitch API isn't instant on updating live status.
- Initial release.