Giter Site home page Giter Site logo

jakelacey2012 / twitchpopups Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daftlimmy-zz/twitchpopups

0.0 2.0 0.0 243 KB

Displays text in a Twitch stream based on the chat

Home Page: http://twitch.tv/Limmy

License: MIT License

JavaScript 82.64% CSS 8.38% HTML 8.99%

twitchpopups's Introduction

TwitchPopups

Allows Twitch mods to display popup text on the stream via chat commands

COMMAND LIST

  • !alert: will display whatever text comes after the !alert command
  • !spotlight [@username]: will display the chat of the specified user from that point on
  • !delete: will delete the popup

DOWNLOAD

The latest version of TwitchPopups can be found as a zip archive here

INSTRUCTIONS

  1. Extract the zip archive
  2. Edit settings.js and change "Limmy" to your Twitch channel name
  3. Use OBS/Streamlabs OBS to add twitchpopups.htm as a browser source (Fit to Screen, 1920x1080)
  4. Tick "Shutdown source when not visible" in browser source properties. That way, any tweaks you make are reloaded when you toggle the visibility button

UPGRADE

  1. Open your existing twitchpopups.htm and copy your configuration settings
  2. Download the latest version
  3. Open the zip archive and open the TwitchPopups-master directory
  4. Select all of the files and drag them into your existing TwitchPopups directory. Say yes to any prompts to overwrite files but be careful not to overwrite your custom animations!
  5. Edit the configuration section at the top of twitchpopups.htm, pasting in your settings from step 1.
  6. If OBS hasn't recognized the update press the "refresh cache of current page" button in browser source properties.

ADVANCED: ADD CUSTOM HANDLERS

If you want to add your own handlers, you will need to understand JavaScript and the tmi.js library. There are a few extra things to consider.

  1. Do you want it to fire based on a !command?
  2. Do you want it to fire on every chat?
  3. What security should prevent the handler being fired? e.g mod only, spotlight only etc.
  4. What should the handler do?

Once you have answered those questions you are ready to add the handler.

  1. Navigate to the handlers.js
  2. If you want a command copy the following code into the file:
actionHandlers['!command'] = {
    security: (context, textContent) => {
        return true; // This should return a boolean, true will fire the handler
    },
    handle: (context, textContent) => {
        // Place handle script here
    }
};
  1. If you want a general command copy the following code into the file:
allHandlers.push({
    security: (context, textContent) => {
        return true; // This should return a boolean, true will fire the handler
    },
    handle: (context, textContent) => {
        // Place handle script here
    }
});
  1. Complete your handler and don't forget to add a description to the readme.md

ADVANCED: POPUP HELPER

The popup helper contains a few functions so you don't need to worry about the animations for the popup box! it can be accessed anywhere by typing popup followed by a function.

Methods:

popup.showText(text, bgColour): Displays popup on screen with the given text and colour.

popup.delete(): Removes popup from screen and resets state of all commands.

popup.formatEmotes(message, emotes, upperCase): Formats text with emotes, This must be past only and all message un-formatted or emotes wont be replaced properly. e.g popup.formatEmotes('Hello Twitch', context.emotes, true).substr(7) The substr function removes the !command, just change the number to the length of the command.

twitchpopups's People

Contributors

cohan avatar daftlimmy-zz avatar gantonator avatar jeddunk avatar m3lbz avatar rcjuk avatar

Watchers

 avatar  avatar

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.