Files
twitch-fish-bot/README.md
Kevin Thompson c7b9e661f5 first commit
2025-06-13 19:43:16 -05:00

2.0 KiB

Twitch Fish Bot

A Go bot that automatically sends !fish to a Twitch channel every 5 minutes.

Project Structure

twitch-fish-bot/
├── cmd/
│   └── main.go
├── internal/
│   ├── clients/
│   │   └── bot.go
│   └── config/
│       └── config.go
├── go.mod
└── README.md

Setup Instructions

Create the project directory:

mkdir twitch-fish-bot
cd twitch-fish-bot

Create the directory structure:

mkdir -p cmd internal/clients internal/config

Create each file with the content provided in the artifacts

Initialize Go module:

go mod init twitch-fish-bot

Update configuration:

Edit internal/config/config.go

Replace the placeholder values with your actual:

Run the bot:

go run cmd/main.go

Getting Credentials

  1. Go to twitchtokengenerator.com
  2. Select "Bot Chat Token"
  3. Get both the OAuth Token and Client ID from the generated output
  4. Update internal/config/config.go with these values

Features

  • Clean architecture with separated concerns
  • Graceful shutdown with Ctrl+C handling
  • Proper logging with timestamps
  • Connection management with automatic PING/PONG handling
  • Error handling throughout the application
  • Client ID support for Helix API compliance
  • Configurable through the config package

Usage

The bot will:

  • Connect to Twitch IRC
  • Join the specified channel
  • Send !fish immediately after joining
  • Continue sending !fish every 5 minutes
  • Run until stopped with Ctrl+C

Notes

  • Make sure your bot account isn't banned from the target channel
  • Consider asking the streamer for permission before running automated bots
  • The bot logs all chat messages - remove this if you prefer privacy