Faster Twitch Alerts is a highly customizable, lightning-fast alternative to Twitch's slow mobile notification system

Overview

Faster Twitch Alerts

maintenance status github last commit github issues github license

What is "Faster Twitch Alerts"?

Faster Twitch Alerts is a highly customizable, lightning-fast alternative to Twitch's slow mobile notification system. Faster Twitch Alerts currently supports two notification platforms: Discord and Pushover.

The program can notify you when:

  • A streamer goes live
  • A streamer goes offline
  • A streamer gets banned
  • A streamer is unbanned
  • A streamer updates their title and/or game

Disclaimer: This program is not associated in any way with Twitch, Discord, or Pushover


Getting Started

  1. Clone the repository
  2. Install the Python 3 and the Python requests library
  3. Set your notification preferences in the config.json File
  4. Run Main.py
    • If the program terminates unexpectedly, check the log file for more information
    • You can terminate the program at any time using 'ctrl+c'

Config Fields Explained

Primary Fields

For more detailed explanations of each field, follow the links

Field Name Required?
Twitch Settings Yes
Logger Settings Yes
Streamers Yes
Discord Settings No
Pushover Settings No

Twitch Settings

This is where we store overall program settings and settings related to the Twitch API

Example Twitch Settings Object:

"Twitch Settings" : {
	"Client ID" : "YOUR CLIENT ID",
	"Secret" : "YOUR SECRET",
	"Reconnect Attempts" : 10,
	"Reconnect Cooldown" : 60,
	"Refresh Rate" : 1
}

Twitch Settings Fields:

Field Name Description Required? Datatypes Alert-Specific Settings Special Formatting
Client ID Your Twitch developer application client ID 1 Yes str Not Allowed Not Allowed
Secret Your Twitch developer application client secret 1 Yes str Not Allowed Not Allowed
Reconnect Attempts The number of times the program will attempt to reconnect to the network during an outage 2 Yes int Not Allowed Not Allowed
Reconnect Cooldown The amount of time (in seconds) that the program will wait before trying to reconnect to the network after a connection failure Yes int, float Not Allowed Not Allowed
Refresh Rate3 The number of times per second to pull new data from the Twitch API Yes int, float Not Allowed Not Allowed

Footnotes:

  • 1 Setting Up a Twitch Developer Application
  • 2 Negative values signal infinite reconnect attempts
  • 3 There is a hard cap on the refresh rate imposed by Twitch API rate limits. You can calculate the refresh rate using the following formula: 20 / (3 * ceil( [# of streamers] / 100 ))

Logger Settings

Settings related to the log file

Example Logger Settings Object:

"Logger Settings" : {
	"Log Level" : "INFO",
	"Log Filepath" : "logs/twitch_alerts.log",
	"Message Text" : "ALERT!"
}

Logger Settings Fields:

Field Name Description Required? Datatypes Alert-Specific Settings Special Formatting
Log Level Allows users to define which messages they receive 1 Yes str Not Allowed Not Allowed
Log Filepath The path (relative to current working directory) of the log file Yes str Not Allowed Not Allowed
Message Text Text to display when an alert is triggered No 2 str Allowed Allowed

Footnotes:

  • 1 More Info on Log Levels:
    • DEBUG: Shows minor network errors
    • INFO: Info about streamer activity, and general program info
    • WARNING: Info about non-fatal errors
    • ERROR: Info about fatal errors
  • 2 A warning will be displayed if field is incomplete and log level is either DEBUG or INFO

Streamers

The JSON object containing settings for all of the streamers we wish to monitor

Example Streamers Object:

"Streamers" : {
	"streamer-username-1" : {
		"Ban Status" : false,
		"User ID" : "123456789"
	},
	"streamer-username-2" : {
		"Ban Status" : true,
		"User ID" : "987654321"
	}
}

Streamer Object Fields:

Field Name Description Required? Datatypes Alert-Specific Settings Special Formatting
Ban Status A Boolean flag used to signal if a streamer is banned 1 Yes bool Not Allowed Not Allowed
User ID A streamer's unique identification number (provided by Twitch) 1 Yes str Not Allowed Not Allowed
Discord Settings Streamer-Specific Discord Settings. For possible fields see Discord Settings 2 No dict N/A N/A
Pushover Settings Streamer-Specific Pushover Settings. For possible fields see Pushover Settings 2 No dict N/A N/A

Footnotes:

  • 1 A streamer's user ID can only be viewed using API calls, it is recommended that you use the set_config.py program in Utils/ to generate the "Streamers" field
  • 2 The "Soon Cooldown" field can only exist in global settings

Sidenote: Global vs. Streamer-Specific Settings

We refer to Discord/Pushover settings within the streamer object as "streamer-specific settings." These settings take precedence over "global settings" in either Discord Settings or Pushover settings. In this way, we can create global settings that will apply to all streamers, and also make fine-grain adjustments to individual streamers' settings.

Discord Settings

Global settings for Discord alerts

Example Discord Settings Object:

"Discord Settings" : {
	"Soon Cooldown" : 300,
	"Alerts" : "all",
	"Webhook URL" : "SOME WEBHOOK URL",
	"Bot Username" : "Faster Twitch Alerts",
	"Avatar URL" :   "Link to Avatar Image",
	"Discord ID" :   "Some Discord ID",
	"Message Text" : "DISCORD ALERT!"
}

Example Discord Settings Fields:

Field Name Description Required? Datatypes Alert-Specific Settings Special Formatting
Soon Cooldown Controls how often changes to an individual streamer's title or game will generate an alert by setting a cooldown period (units = seconds) Yes int, float Not Allowed Not Allowed
Alerts Controls what types of messages will generate an alert No str Allowed Not Allowed
Webhook URL The Webhook URL for the Discord channel which will receive the alert No1 str Allowed Allowed
Bot Username The display name of the bot that will be the sender of the alert No str Allowed Allowed
Avatar URL A direct link to an image that will be the Discord bot's avatar No str Allowed Allowed
Discord ID2 A Discord role/user ID that can be used to tag members of a Discord server. See below for examples No str Allowed Allowed
Message Text Text to display when an alert is triggered No1 str Allowed Allowed

Footnotes:

  • 1 These fields must be defined for all active alert types in either global settings or streamer-specific settings otherwise the program will terminate
  • 2 You can find user/role ID's by activating "Developer Mode" on Discord

Discord Message Tips:

Mentions:

<@discord_id>" Roles: "<@&discord_id>"">
Users: "<@discord_id>"
Roles: "<@&discord_id>"

Using a Custom Server Emoji:

<:emoji_alias:emoji_id>" Animated: " "">
Normal:    "<:emoji_alias:emoji_id>"
Animated: "
    
     "

    



Pushover Settings

Global settings for Pushover alerts

Example Pushover Settings Object:

"Pushover Settings" : {
	"Soon Cooldown" : 300,
	"Alerts" : "all",
	"API Token" : "YOUR API TOKEN",
	"Group Key" : "YOUR GROUP KEY",
	"Devices" : "Some Devices",
	"Priority" : 1,
	"Embed URL" : "https://www.twitch.tv/{name.lower()}",
	"URL Title" : "Go To Stream",
	"Sound" : "Some Sound",
	"Message Title" : "Faster Twitch Alerts",
	"Message Text" : {
		"live" : "{name} is Live Right Now! \ud83d\udce1",
		"title" : "{name} Might Be Going Live Soon! \u231b",
		"game" : "{name} Might Be Going Live Soon! \u231b",
		"offline" : "{name} Just Went Offline \ud83d\ude14",
		"ban" : "{name} Just Got Banned \u2696\ufe0f",
		"unban" : "{name} has Been Unbanned! \ud83c\udf89"
	}
}

Example Pushover Settings Fields:

Field Name Description Required? Datatypes Alert-Specific Settings Special Formatting
Soon Cooldown Controls how often changes to an individual streamer's title or game will generate an alert by setting a cooldown period (units = seconds) Yes int, float Not Allowed Not Allowed
Alerts Controls what types of messages will generate an alert No str Allowed Not Allowed
API Token1 Pushover API token No2 str Allowed Allowed
Group Key1 Pushover User or Group Key No2 str Allowed Allowed
Devices1 Comma-separated list of device names to send the alert to No str Allowed Allowed
Priority1 Integer from -2 to 2 that specifies how important the alert is No int Allowed Not Allowed
Embed URL1 Supplementary URL for the alert No str Allowed Allowed
URL Title1 The text to display for the "Embed URL" No str Allowed Allowed
Sound1 The name of the sound to play for the alert No str Allowed Allowed
Message Title1 The title of the alert No str Allowed Allowed
Message Text Text to display when an alert is triggered No2 str Allowed Allowed

Footnotes:



Alert-Specific Settings

For certain fields, we may want to change our preferences based on the type of alert being triggered. This is fairly easy to do, we can simply create a JSON object of alert-type keywords and specify different parameters for each keyword.

Alert-Specific Settings Example:

Without Alert-Specific Settings:

"Message Text" : "Some Alert Message"

With Alert-Specific Settings:

"Message Text" : {
	"live"    : "Some 'Live' Message",
	"offline" : "Some 'Offline' Message",
	"ban"     : "Some 'Ban' Message",
	"unban"   : "Some 'Unban' Message",
	"title"   : "Some 'Title Change' Message",
	"game"    : "Some 'Game Change' Message"
}

Alert Types

Faster Twitch Alerts can send alerts for many types of events. Below are the keywords describing each alert type

Alert Type Description
live The streamer went live
offline The streamer went offline
ban The streamer was banned
unban The streamer's ban ended
title The streamer updated their stream's title (while offline)
game The streamer switched categories (while offline)

Keyword Mapping

For the sake of efficiency, we've provided additional keywords that specify multiple alert fields. Below you can see the keywords and which alert types they map to.

Alert Type Description
all live, offline, ban, unban, title, game
none1
bans ban, unban
soon title, game

Footnotes:

Alerts Field

The Alerts field is used to toggle certain alert types on and off.

Valid "Alerts" Formats:

Boolean Keyword Dictionary:

"Alerts" : {
	"live"    : true
	"offline" : true,
	"ban"     : true,
	"unban"   : true,
	"title"   : true,
	"game"    : true
}

Comma-Separated Keywords in String Format:

"Alerts" : "live, offline, ban, unban, title, game"

Negation Operator:

'!' Can be used in front of a keyword to negate that keyword

Note that keywords are parsed in order, for example

  • "all, !live" -> Alerts for everything except "live"
  • "!live, all" -> Alerts for everything, even "live"


Special Formatting

Sometimes we want more customization beyond what a normal string can offer. For this reason we've created a special formatting system for certain fields.

Here's how it works:

Every statement in curly braces will be evaluated by the formatter. The formatter understands Python and expects a string to be returned by whatever is contained in the braces.

There are a few local variables we can use as well. These fields will change depending on the alert type and the streamer.

Variable Description
time Evaluates to time.localtime()
name The username of the streamer
title The streamer's current stream title
game The streamer's current game category
message The alert type of the message
discord_id The user-specified Discord ID for the message

Due to the way Python interprets strings, we may need alternate ways to specify escape characters. Below are the currently available alternatives

Variable Description
nl newline
tb tab
dq double quote
sq single quote

Examples:

Basic Example:

"Message Text" : {
	"ban" : "{name} Was Just Banned",
	"unban" : "{name} Was Just Unbanned",
	"live" : "{name} Just Went Live",
	"offline" : "{name} Just Went Offline",
	"title" : "{name} Changed Their Title to \"{title}\"",
	"game" : "{name} Changed Their Game to \"{game}\""
}

String Formatting Example:

"Bot Username" : "{name.capitalize()} - {message.capitalize()}"

If/Else Statement Example:

"Message Text" : {
	"bans" : "{name} Was Just {'Ban' if message=='ban' else 'Unban'}ned"
}

Owner
Epic gamer
With Google Drive API. My computer and my phone are in love now.

Channel trought Google Drive Google Drive API In this case, "Google Drive App" is the program. To install everything you need(has some extra things),

Luis Quiñones Requelme 1 Dec 15, 2021
A simple python discord bot which give you a yogurt brand name, basing on a large database often updated.

YaourtBot A discord simple bot by Lopinosaurus Before using this code : ・Move env file to .env ・Change the channel ID on line 38 of bot.py to your #pi

The only one bunny who can dev. 0 May 09, 2022
This is a simple bot for running Python code through Discord

Python Code Runner Discord Bot This is a simple bot for running Python code through Discord. It was originally developed for the Beginner.Codes Discor

beginner.py 1 Feb 14, 2022
Automatically commits and pushes changes from a specified directory to remote repository

autopush a simple python program that checks a directory for updates and automatically commits any updated files (and optionally pushes them) installa

carreb 1 Jan 16, 2022
A discord.py code generator program. Compatible with both linux and windows.

Astro-Cord A discord.py code generator program. Compatible with both linux and windows. About This is a program made to make discord.py bot developmen

Astro Inc. 2 Dec 23, 2021
A discord token grabber made in Python 3

Discord Token Grabber A Discord token grabber written in Python 3. This version of the grabber only supports Windows. Features Transfers via Discord w

Mega145 4 Aug 04, 2022
Report-snapchat - Report Snapchat acc with python

report-snapchat Report Snapchat acc Report users on Snapchat about the tool : 4

17 Dec 01, 2022
Mventory is an API-driven solution for Makerspaces, Tinkerers, and Hackers.

Mventory is an API-driven inventory solution for Makers, Makerspaces, Hackspaces, and just about anyone else who needs to keep track of "stuff".

Make Monmouth 107 Dec 21, 2022
A Discord Self bot written in python

WitheredBot A Discord Self bot written in python Requirement Python = 3.9 How to Configure git clone https://github.com/a-a-a-aa/WitheredBot.git cd W

......... 0 Jan 05, 2023
Want to play What Would Rather on your Server? Invite the bot now! 😏

What is this Bot? 👀 What You Would Rather? is a Guessing game where you guess one thing. Long Description short Take this example: You typed r!rather

FSP Gang s' YT 3 Oct 18, 2021
🛒 Bot de lista de compras compartilhada para o Telegram

Lista de Compras Lista de compras de Cuducos e Flávia. Comandos do bot Comando Descrição /add item Adiciona item à lista de compras /remove item

Eduardo Cuducos 4 Jan 15, 2022
A simple Telegram bot which handles images in whole different way

zeroimagebot thezeroimagebot 🌟 I Can Edit Dimension Of An image which is required by @stickers 🌟 I Can Extract Text From An Image 🌟 !!! New Updates

RAVEEN KUMAR 4 Jul 01, 2021
Super Fast Telegram UserBot Made With Python.

Description Super Fast Telegram UserBot Made With Python. LOGO Made With Support of All Userbots Dev's Dark-Venom is a Light-Weight Userbot. It's unde

2 Sep 14, 2021
Accurately dump Commodore 64 tapes

TrueTape64 A cheap, easy to build adapter to interface a Commodore 1530 (C2N) Datasette to your PC to dump and preserve your aging Commodore 64 softwa

francesco 38 Dec 03, 2022
The Fastest multi spambot of Telegram 🤞 🤞

Revil Spam Bot The Fastest multi spambot of Telegram 🤞 🤞 𝚂𝚄𝙿𝙿𝙾𝚁𝚃 🖤 ᴄʀᴇᴀᴛᴏʀ 🖤 ⚡ 𝓡𝓮𝓿𝓲𝓵 𝓗𝓾𝓷𝓽𝓮𝓻 𝔐𝔲𝔩𝔱𝔦 ẞø✞︎ ⚡ 𝓐 𝕾мοοτн 𝓐и∂ 𝕱

REVIL HUNTER 4 Dec 08, 2021
New developed moderation discord bot by archisha

Monitor42 New developed moderation discord bot by αrchιshα#5518. Details Prefix: 42! Commands: Moderation Use 42!help to get command list. Invite http

Kamilla Youver 0 Jun 29, 2022
This is a repository for the Duke University Cloud Computing course project on Serveless Data Engineering Pipeline. For this project, I recreated the below pipeline.

AWS Data Engineering Pipeline This is a repository for the Duke University Cloud Computing course project on Serverless Data Engineering Pipeline. For

15 Jul 28, 2021
ResolveURL - Fork of UrlResolver by eldorados, tknorris and jsergio123

ResolveURL Fork of UrlResolver by eldorados, tknorris and jsergio123 I am in no

gujal 60 Jan 03, 2023
MCNameBot is a fast discord bot that is used to check the availability of a Minecraft name with a simple command.

MCNameBot MCNameBot is a fast discord bot that is used to check the availability of a Minecraft name with a simple command. If you would like to just

Killin 2 Oct 11, 2022
Data portal client and server for NMDC.

NMDC Server and Client Portal Getting started with Docker install ldc install submodules via git submodule update --init --recursive In order to popul

National Microbiome Data Collaborative 7 Dec 14, 2022