npm install
config/config.js
(HIGHLY RECOMMENDED) Start the application in Production Mode
npm start
If you are a developer go into Development Mode (Requires Source Code)
process.env.NODE_ENV = "development"
npm dev
A configuration file can be found in ./config/config.js
. Configure all settings as you desire.
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'],
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}}!',
},
},
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).
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 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.
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)
process.env.NODE_ENV = "development"
v1.0.6 (04 September 2018)
bitThresholds
allowing for custom message for a custom bit amount. Thanks to 6mas for the suggestion in [i15] . If there are bugs, please let me know as I'm unable to test this.v1.0.5 (10 July 2018)
message
variable support to resubscriptionsv1.0.4 (20 June 2018)
package.json
v1.0.3 (16 March 2018)
v1.0.2 (18 September 2017)
README.md
and package.json
versioningv1.0.1 (17 September 2017)
prettyPrint: true
to Logger.js
for better console output{{message}}
variablev1.0.0 (13 September 2017)
v0.2.0
message
in default subscription notify due to TwitchNotify changesmessage
sometimes displaying as null
during resubv0.1.0