StreamNotifier

module
v1.1.2-0...-afe3b38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT

README

StreamNotifier

Go

A CLI tool that monitors Twitch streamer status changes via polling and sends notifications to Discord Webhooks.

日本語

Features

  • Real-time monitoring of Twitch streamer status via Helix API polling
  • Discord Webhook notifications for:
    • Stream online / offline
    • Title changes
    • Game/category changes
  • Multi-streamer and multi-webhook support per streamer
  • Interactive CLI menu for configuration management
  • Structured logging with slog (colored console + JSON file)

Requirements

  • Go 1.25+
  • Twitch Developer Application (dev.twitch.tv)
  • Discord Webhook URL(s)

Quick Start

1. Clone and build
git clone https://github.com/yuu1111/StreamNotifier.git
cd StreamNotifier
make build
2. Configure

Copy the example config and fill in your credentials:

cp config.example.json config.json
{
  "twitch": {
    "clientId": "your_twitch_client_id",
    "clientSecret": "your_twitch_client_secret"
  },
  "polling": {
    "intervalSeconds": 30
  },
  "streamers": [
    {
      "username": "streamer_name",
      "webhooks": [
        {
          "name": "Main Notification",
          "url": "https://discord.com/api/webhooks/...",
          "notifications": {
            "online": true,
            "offline": true,
            "titleChange": true,
            "gameChange": true
          }
        }
      ]
    }
  ],
  "log": {
    "level": "info"
  }
}
3. Run
./stream-notifier

Or use the interactive CLI:

./stream-notifier help

Docker

docker build -t stream-notifier .
docker run -v ./config.json:/app/config.json:ro -v ./logs:/app/logs stream-notifier

Build

make build          # Build for current platform
make build-all      # Build for Linux, Windows, macOS
make clean          # Remove build artifacts

Architecture

cmd/stream-notifier/main.go    Entry point
internal/
├── cli/cli.go                 Interactive menu + subcommands
├── config/config.go           Config struct, JSON loader, validation
├── discord/
│   ├── embed.go               Discord embed builder
│   └── webhook.go             Webhook sender
├── monitor/
│   ├── detector.go            State change detection
│   ├── poller.go              Periodic polling
│   └── state.go               In-memory streamer state
└── twitch/
    ├── api.go                 Helix API client
    ├── auth.go                OAuth2 Client Credentials
    └── types.go               API response types

Data flow: PollerTwitchAPIDetectChangesBuildEmbedSendWebhook

License

MIT

Directories

Path Synopsis
cmd
stream-notifier command
Package main はStream Notifierのエントリーポイントを提供する
Package main はStream Notifierのエントリーポイントを提供する
internal
cli
Package cli は設定管理CLIを提供する
Package cli は設定管理CLIを提供する
config
Package config はアプリケーション設定の読み込み・保存・バリデーションを提供する
Package config はアプリケーション設定の読み込み・保存・バリデーションを提供する
discord
Package discord はDiscord Webhook連携を提供する
Package discord はDiscord Webhook連携を提供する
monitor
Package monitor は配信者の状態監視と変化検出を提供する
Package monitor は配信者の状態監視と変化検出を提供する
twitch
Package twitch はTwitch Helix APIクライアントを提供する
Package twitch はTwitch Helix APIクライアントを提供する

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL