Skip to content

Instantly share code, notes, and snippets.

Avatar
💜
Doing something

Jacob Foster AlcaDesign

💜
Doing something
View GitHub Profile
View profile.json
{"version":2,"type":"profile","profile":{"id":7,"name":"Coding Garden","hotkey":null,"pause_updates":null,"description":"Commands for CodingGarden","context":[{"id":"5b66b0d5-0d11-4d41-af47-4d4ef92047db","type":"Channel","data":{"login":"codinggarden","id":"413856795"}}]},"toggled":true,"values":{"chat.actions.room":[{"t":"inherit","id":"1657045451549-0.39029851003637184-0"},{"v":{"action":"chat","appearance":{"type":"image","text":"Topic","image":"https://sfo2.digitaloceanspaces.com/alca/static/f/cj/Timer_Start_opt.png","tooltip":"!focus-start"},"options":{"command":"!focus-start 30","paste":true},"display":{}},"id":"1657042750748-0.43892151947400904-0"},{"v":{"action":"chat","appearance":{"type":"image","text":"Topic","image":"https://sfo2.digitaloceanspaces.com/alca/static/f/cj/Timer_Stop_opt.png","tooltip":"!focus-end"},"options":{"command":"!focus-end","paste":false},"display":{}},"id":"1657047049848-0.7201918069457542-1"}]}}
@AlcaDesign
AlcaDesign / main.js
Last active May 2, 2022
An example for tracking mystery gift subs - https://github.com/tmijs/tmi.js/discussions/515
View main.js
/**
* How long to wait in milliseconds if Twitch is taking too long to respond with
* all of the gifts.
*/
const MYSTERYGIFT_TIMEOUT_MS = 10 * 1000;
/**
* How long to wait in milliseconds if the detected gift sub is not part of a
* larger mystery gift initially.
*/
const GIFTSUB_ORPHAN_TIMEOUT_MS = 2 * 1000;
@AlcaDesign
AlcaDesign / index.html
Last active Jan 16, 2022
tmi.js with BTTV emotes
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>BTTV Emotes Gist</title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://d2g2wobxbkulb1.cloudfront.net/0.0.18/tmi.min.js"></script>
<script src="js/main.js"></script>
</head>
@AlcaDesign
AlcaDesign / index.html
Last active Aug 15, 2021
[OUTDATED] An almost complete tmi.js example (browser)
View index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Chat</title>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'>
<link href="style.css" rel="stylesheet" type="text/css">
<script src="https://d2g2wobxbkulb1.cloudfront.net/0.0.19/tmi.js"></script> <!--For developement-->
<!--<script src="https://d2g2wobxbkulb1.cloudfront.net/0.0.19/tmi.min.js"></script>--> <!--For "production"-->
</head>
View index.js
'use strict';
const tmi = require('tmi.js'),
timerMessages = [],
config = {
identity: {
username: '',
password: ''
@AlcaDesign
AlcaDesign / custom-events.js
Created Feb 10, 2019
Custom USERNOTICE events, ahead of 1.4.0. (Examples included in `index.js`)
View custom-events.js
const tmiParse = require('tmi.js/lib/parser');
const escapedIRCRegex = /\\([sn:r\\])/g;
const ircEscapedChars = { s: ' ', n: '', ':': ';', r: '' };
const booleanTagKeys = [ 'mod', 'subscriber', 'msg-param-should-share-streak' ];
const integerTagKeys = [
'tmi-sent-ts', 'msg-param-months', 'msg-param-cumulative-months',
'msg-param-streak-months', 'msg-param-sender-count',
'msg-param-mass-gift-count', 'msg-param-viewerCount', 'msg-param-threshold',
'msg-param-bits-amount', 'msg-param-min-cheer-amount',
View index-1.js
//...
client.on('message', (channel, user, message, fromSelf) => {
// Ignore bot's messages.
if(fromSelf) {
return false;
}
// The name of the user. (Will default to the lower case if the display name
// is missing from the user object.)
@AlcaDesign
AlcaDesign / SniffingBot.js
Last active Dec 2, 2018
Code sniffing bot from multiple Twitch channels. Aggregates the codes to a specific channel for more chances at codes.
View SniffingBot.js
const _request = require('request'),
_ = require('lodash'),
tmi = require('tmi.js'),
clc = require('cli-color'),
config = require('./config.json'),
yourChannel = config.yourChannel || '',
identity = config.identity || {},
@AlcaDesign
AlcaDesign / index.js
Created Jan 8, 2017
A command bot example
View index.js
const tmi = require('tmi.js'),
request = require('request'),
countdown = require('countdown'),
kraken = request.defaults({
baseUrl: 'https://api.twitch.tv/kraken/',
json: true,
headers: {
'Client-ID': '',
Accept: 'application/vnd.twitchtv.v3+json'
@AlcaDesign
AlcaDesign / chat-lines-tweaks.css
Last active Apr 29, 2018
Alca's custom CSS for modch.at (https://modch.at) | Sections are separated into files and "modch.at-custom.css" is all of them together.
View chat-lines-tweaks.css
.chat-lines {
font-size: 14px;
}