Giter Club home page Giter Club logo

twitch-shoutout-bot's Introduction

Twitch Auto Shoutout Bot

๐Ÿค– A simple Twitch bot that automatically sends !so @user in chat after your stream has been live for a preset amount of time.

For use with bots that have !so commands, essentially acts as an auto shoutout for services that don't have this functionality built in (e.g. StreamElements).

Much of the code (and like 100% of the installation instructions below) was used from Timbot

Feeling generous?

Buy me a Coffee

Features

  • Monitors Twitch chat for users in the shout out list and shouts them out when they talk for the first time.
  • Programmable delay, so the shout out happens later in your stream rather than at the very beginning.
  • Bot commands for mods to add or remove streamers from the shout out list (!addso/!rmso).

Installation and setup

Prerequisites

This bot is built with Node.js. Install the latest LTS version from the official website.

Installation

To set up the bot, clone it using git:

git clone [email protected]:brofar/Twitch-Shoutout-Bot.git

Once installed, enter the directory and install the dependencies:

cd Twitch-Shoutout-Bot
npm install

Configuration

To configure the bot, copy the included .env.sample to .env and enter or customize the values in the file.

Configuration options explained:

Key Required? Description
BOT_USERNAME โ˜‘ The username of your bot (can be either your own username, or you can create another Twitch account for your bot).
BOT_OAUTH_TOKEN โ˜‘ Your bot token (explained below).
CHANNEL_NAME โ˜‘ The Twitch channel the bot should join (i.e. your channel).
BOT_CLIENT_ID โ˜‘ Client ID for your Twitch app, via developer portal (explained below).
BOT_CLIENT_SECRET โ˜‘ Client Secret for your Twitch app, via developer portal (explained below).
MIN_TO_WAIT_BEFORE_SHOUTOUT โ˜‘ How many minutes your stream should be live before the bot starts monitoring (for immediate shoutouts, enter 0).
TWITCH_PREFIX โ˜‘ Prefix for the bot's commands.

Getting required tokens

Note that you will need to set up some external applications:

Twitch application

To connect to the Twitch API, you will need to register a new application in the Twitch Developers Console as the user you've listed in BOT_USERNAME.

You will need to grab the Client ID (BOT_CLIENT_ID in .env). Then, create a new secret and copy that into BOT_CLIENT_SECRET in .env

Twitch OAuth token

To make things more complicated, all requests to the Twitch API need to be authenticated with an OAuth grant generated by your own application.

To begin the authorization flow, you'll need to complete the authorization prompt yourself as the user you've listed in BOT_USERNAME:

https://id.twitch.tv/oauth2/authorize?client_id=TWITCH_CLIENT_ID&response_type=token&redirect_uri=http://localhost

You can grab the access_token from the redirect URL in your browser, and store it as BOT_OAUTH_TOKEN in .env.

Starting the bot

Once the application has been configured, start it using node from the installation directory:

node .

twitch-shoutout-bot's People

Contributors

brofar avatar

Stargazers

ChrisP avatar

Watchers

James Cloos avatar  avatar

Forkers

zeroshi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.