Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ColeWalker/twitchircgo
A twitch irc client for Golang
https://github.com/ColeWalker/twitchircgo
go golang irc twitch twitch-bot twitch-bots twitch-irc
Last synced: 3 months ago
JSON representation
A twitch irc client for Golang
- Host: GitHub
- URL: https://github.com/ColeWalker/twitchircgo
- Owner: ColeWalker
- License: mit
- Created: 2020-07-16T14:24:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-26T20:45:29.000Z (over 4 years ago)
- Last Synced: 2024-06-25T11:44:28.980Z (5 months ago)
- Topics: go, golang, irc, twitch, twitch-bot, twitch-bots, twitch-irc
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-twitch-dev - ColeWalker/twitchircgo - Twitch IRC client for Golang. (Libraries / Golang)
README
# Go Twitch IRC Client
This repository contains a Go client for interacting with Twitch IRC channels.
# Example
main.go contains the following example which will receive each message in my channel (supcole) and log information about it and the user who sent it to the console. To be able to run this, you must have Twitch API credentials.
```go
chatToken := twitchircgo.RefreshAuth("refresh token goes here","client id goes here", "client secret goes here")
bot := newBot(chatToken, []string{"#channel", "#anotherchannel"}, "botusername")
bot.Connect()for {
message := <-bot.OnMessage
fmt.Printf("got message %+v\n",message)
}```
Messages in the above code segment are sent to the channel OnMessage, and saved to a local variable.
Message objects contain user information and the contents of the message itself.