mekpower / twitchHost-bot

A bot to auto host twitch channels by another channel, through automatic draw.
1 stars 0 forks source link

Twitch Bot 🤖: A bot to auto host channels

twitch

github-stars commit patreon Codacy Badge

A bot to auto host twitch channels by another channel, through automatic draw.

This bot is based on the twitch-bot. If you want to learn more about possible functions, access the twitch-bot NPM here: twitch-bot.

How install

  1. Clone the git.

How execute

Use node bot.js or if you prefer updating without having to close, use nodemon bot.js.

How configure

First, enter the main file, bot.js. There are two variables that define the name of the channel which will be the bot and the prefix used for the commands.

Variables

Variable name Default Description
channelName null It is the name which will be the bot. It must be the same as the twitch username.
prefix ! Prefix used to call commands.

Bot Sign In

For the login of the bot to be carried out, the usual password is not used, for this, oauth is used. To have oauth from the bot account, access the following link: twitch oauth.

const Bot = new TwitchBot({
    username: channelName,
    oauth: 'oauth:8df8f12vbu8v7u98vu7238v2mm',
    channels: [channelName]
  })

The channels is where all the channels that the bot will be. Because it is a bot with the idea of auto host, the channelName variable was used to leave only the channel itself. If you are making a bot for another purpose, the channels should be divided by a comma (eg: [kekw, PogU, Pepega]).

How create new commands

There are two possibilities for adding new commands:

exports.run = async (Bot, message, username, subscriber, mod) => {
//code inside
}
if(chatter.message === '!test') {
    Bot.say('Command executed! PogChamp')
}

Help me

My native language is not English, so this tutorial is probably not well translated. If you are interested, help me.

We can always improve and optimize the code! If you see any inconsistencies, errors or possible improvements, help the community!