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:
- Bot username
- OAuth token (from twitchtokengenerator.com)
- Client ID (from twitchtokengenerator.com - required as of May 1st)
- Target channel name
Run the bot:
go run cmd/main.go
Getting Credentials
- Go to twitchtokengenerator.com
- Select "Bot Chat Token"
- Get both the OAuth Token and Client ID from the generated output
- 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
Description
Languages
Go
100%