d0p3t / SubNotifier

🔔 Simple Sub, Gifted Sub, and Resub Notifier for Twitch Chat (also supports Cheers) 🎮
ISC License
10 stars 3 forks source link
alert bits nodejs resub subscription twitch twitchbot
# SubNotifier (v1.0.9-1) ##### A Simple Sub and Resub Notifier for Twitch Chat ![Version](https://img.shields.io/badge/version-1.0.9.1-green.svg) [![Discord](https://img.shields.io/discord/330910293934997504.svg)](https://discord.gg/bSd4cYJ) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)]() ### Want to use SubNotifier but need a Host? Follow + Tweet me [@d0p3t](https://twitter.com/d0p3t)

Features


Screenshot

![Alert](https://pbs.twimg.com/media/DJZXK-SXoAEVw2_.jpg)

Quickstart

  1. Install NodeJS
  2. Download and Extract Latest Release
  3. Open a terminal window and navigate to the directory
  4. Install dependencies npm install
  5. Edit config/config.js

(HIGHLY RECOMMENDED) Start the application in Production Mode

If you are a developer go into Development Mode (Requires Source Code)


Configuration

A configuration file can be found in ./config/config.js. Configure all settings as you desire.

Connecting to Twitch Chat

To be able to connect to Twitch chat, you have to register an application and get an OAuth token with the correct scopes. You will also have to specify at least one channel. Please keep in mind that you need custom alerts for each channel if you have enableCustomMessages: true.

clientId: 'xxxxxxxxxxxxxxxx',
username: 'd0p3tbot',
token: 'xxxxxxxxxxxxxxxxx',
channels: ['#d0p3t', '#summit1g', '#ninja'],

Configure Chat Messages

There are three types of chat notifiers, we call them Chat Alerts.

You can use as many custom chat alerts as you wish. If you activate custom chat alerts, you MUST set at least 1 custom chat alert per type and channel. If custom alerts are not enabled, it will default to predefined messages.

Within the chat alerts you can use various variables. Below is a list of available variables with a description and where you can use them.

Variable Description Uses
{{username}} Displays the username of the (re)subscriber/cheerer subscriptions, resubscriptions, bits, bitsThresholds
{{months}} Number of months resubscribed resubscriptions
{{years}} Displays # years if 1 year or more (as [ X year(s) and X month(s) ]) resubscriptions
{{bits}} Amount of bits cheered bits
{{message}} Message sent with event subscriptions, resubscriptions, bits, bitsThresholds
{{recipient}} Recipient of a gifted subscription giftsubscriptions
'#d0p3t': {
  subscriptions: {
    custom1: 'PogChamp SUB Thank you for subscribing {{username}}',
    custom2: 'CoolStoryBob SUB Thank you for subscribing {{username}}',
    custom3: 'DansGame SUB Thank you for subscribing {{username}}' },
  giftsubscriptions: {
    custom1: 'PogChamp SUB Thank you for gifting {{recipient}} a subscription, {{username}}',
    custom2: 'CoolStoryBob SUB Thank you for gifting {{recipient}} a subscription, {{username}}',
    custom3: 'DansGame SUB Thank you for gifting {{recipient}} a subscription, {{username}}' },
  resubscriptions: {
    custom1: 'PogChamp RESUB Thank you {{username}} for resubscribing for {{months}} months! {{years}} {{message}}',
    custom2: 'WutFace RESUB Thank you {{username}} for resubscribing for {{months}} months! {{years}}',
    custom3: '<3 RESUB Thank you {{username}} for resubscribing for {{months}} months! {{years}}' },
  bits: {
    custom1: 'Wowzers, {{username}} cheered {{bits}} BITS!',
    custom2: 'Oh so kind, {{username}} with the {{bits}} BITS!',
    custom3: 'LUL we got a happy cheerer over here ({{username}}: {{bits}} bits)!' },
    bitsThresholds: {
      1000: '1000 BITS from {{username}} with the message {{message}}!',
      5000: '{{username}} just sent 5000 BITS our way! What an amazing person',
      10000: 'This is insane, 10000 BITS from {{username}}!',
      25000: '25000 BITS! I don\'t know what to say, {{username}}',
      50000: '50000 BITS from {{username}} and they said: {{message}}!',
      75000: '75000 BITS cheers by the gracious {{username}}!',
      100000: 'What does heaven feel like? Right, 100000 BITS from {{username}}!',
    },
},

Enable/Disable Features

There also various settings that you can enable (true) or disable (false).

Setting Description Default
enableSecureMode Connects to Twitch chat with SSL (443) true
enableMeMode Chat alerts start with /me true
enableSubAlerts Enables subscription chat notifications true
enableGiftSubAlerts Enabled gift subscription chat notifications true
enableResubAlerts Enables resubscriptions chat notifications true
enableBitAlerts Enables bits chat notifcations false
enableCustomMessages Enables custom chat alerts true

If you've configured everything correctly, you will now be able to start SubNotifier and upon a successful connection will see CONNECTED: Waiting for events.... If you are still having issues, please refer to the sample configuration file first and then open an issue (see below).


Issues

If you have any issues or questions, open an issue or tweet me @d0p3t.

For configuration file problems, please first check whether your syntax is correct and you aren't missing any commas or brackets. SubNotifier has a failsafe against missing custom messages, but will not revert to the defaults if enableCustomMessages: true and there is a problem with the configuration file.


Thank You!

Thank you to the creators and maintainers of twitch-js for providing easy access to TwitchNotify events and Twitch Chat.

Also a great thank you to Ikatzuki and dinu for discussing and coming up with new features. Without you SubNotifier wouldn't have improved as it did now.

bitmoji


Changelog

v1.0.9-1 (04 July 2019)

v1.0.9 (05 March 2019)

v1.0.8 (04 March 2019)

v1.0.7 (01 February 2019)

v1.0.6 (04 September 2018)

v1.0.5 (10 July 2018)

v1.0.4 (20 June 2018)

v1.0.3 (16 March 2018)

v1.0.2 (18 September 2017)

v1.0.1 (17 September 2017)

v1.0.0 (13 September 2017)

v0.2.0

v0.1.0