Skip to content

Concelare/gotwitchalerts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Go TwitchAlerts

A go package to allow the user to detect when a streamer is live and trigger a custom event. Requests are currently rate limited at 80ms since that that is the fastest the Twitch api allows. Each streamer has a thirty-second cooldown between checks, delay between check runs is customisable in the config file.

If you find any bugs or have a feature request, please report them on GitHub and any improvements or additions are welcome through pull requests.

Features

  • Customisable Events
  • Configurable
  • Easy Error Handling

Setup

Install

Run the command -

go get github.com/concelaredev/gotwitchalerts

In your go.mod

module example

go 1.21

require github.com/concelaredev/gotwitchalerts v1.0

Import into file

package main

import "github.com/concelaredev/gotwitchalerts"

func main() {
}

Configuration

The first run will create a config file, this should contain the client-id, token, delay and list of streamers to monitor.

To get your OAuth token for twitch go to https://dev.twitch.tv/console create an application and use the Client ID & Secret with the command below

curl -X POST 'https://id.twitch.tv/oauth2/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'client_id=<your client id goes here>&client_secret=<your client secret goes here>&grant_type=client_credentials'

Example Config

{
  "user_id":"your_user_id",
  "token":"your_token",
  "streamers":["streamer1", "streamer2"],
  "delay":80
}

Dependencies

  • encoding/json
  • io
  • log
  • net/http
  • os
  • slices
  • strings
  • time

Contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages