go irc client for twitch.tv

Overview

go-twitch-irc Coverage Status

This is an irc client for connecting to twitch. It handles the annoying stuff like irc tag parsing. I highly recommend reading the documentation below, but this readme gives a basic overview of the functionality.

Documentation: https://pkg.go.dev/github.com/gempir/go-twitch-irc/v2?tab=doc

Getting Started

package main

import (
	"fmt"

	"github.com/gempir/go-twitch-irc/v2"
)

func main() {
	// or client := twitch.NewAnonymousClient() for an anonymous user (no write capabilities)
	client := twitch.NewClient("yourtwitchusername", "oauth:123123123")

	client.OnPrivateMessage(func(message twitch.PrivateMessage) {
		fmt.Println(message.Message)
	})

	client.Join("gempir")

	err := client.Connect()
	if err != nil {
		panic(err)
	}
}

Available Data

The twitch.User and MessageType structs reflect the data Twitch provides, minus any fields that have been marked as deprecated:

type User struct {
	ID          string
	Name        string
	DisplayName string
	Color       string
	Badges      map[string]int
}

type WhisperMessage struct {
	User User

	Raw       string
	Type      MessageType
	RawType   string
	Tags      map[string]string
	Message   string
	Target    string
	MessageID string
	ThreadID  string
	Emotes    []*Emote
	Action    bool
}

type PrivateMessage struct {
	User User

	Raw     string
	Type    MessageType
	RawType string
	Tags    map[string]string
	Message string
	Channel string
	RoomID  string
	ID      string
	Time    time.Time
	Emotes  []*Emote
	Bits    int
	Action  bool
}

type ClearChatMessage struct {
	Raw            string
	Type           MessageType
	RawType        string
	Tags           map[string]string
	Message        string
	Channel        string
	RoomID         string
	Time           time.Time
	BanDuration    int
	TargetUserID   string
	TargetUsername string
}

type ClearMessage struct {
	Raw         string
	Type        MessageType
	RawType     string
	Tags        map[string]string
	Message     string
	Channel     string
	Login       string
	TargetMsgID string
}

type RoomStateMessage struct {
	Raw     string
	Type    MessageType
	RawType string
	Tags    map[string]string
	Message string
	Channel string
	RoomID  string
	State   map[string]int
}

type UserNoticeMessage struct {
	User User

	Raw       string
	Type      MessageType
	RawType   string
	Tags      map[string]string
	Message   string
	Channel   string
	RoomID    string
	ID        string
	Time      time.Time
	Emotes    []*Emote
	MsgID     string
	MsgParams map[string]string
	SystemMsg string
}

type UserStateMessage struct {
	User User

	Raw       string
	Type      MessageType
	RawType   string
	Tags      map[string]string
	Message   string
	Channel   string
	EmoteSets []string
}

type GlobalUserStateMessage struct {
	User User

	Raw       string
	Type      MessageType
	RawType   string
	Tags      map[string]string
	EmoteSets []string
}

type NoticeMessage struct {
	Raw     string
	Type    MessageType
	RawType string
	Tags    map[string]string
	Message string
	Channel string
	MsgID   string
}

type UserJoinMessage struct {
	// Channel name
	Channel string

	// User name
	User string
}

type UserPartMessage struct {
	// Channel name
	Channel string

	// User name
	User string
}

For unsupported message types, we return RawMessage:

type RawMessage struct {
	Raw     string
	Type    MessageType
	RawType string
	Tags    map[string]string
	Message string
}

Available Methods

ParseMessage parses a raw Twitch IRC message into a User and a message object. User can be nil.

func ParseMessage(line string) (*User, interface{})

Client Methods

These are the available methods of the client so you can get your bot going:

func (c *Client) Say(channel, text string)
func (c *Client) Whisper(username, text string)
func (c *Client) Join(channel string)
func (c *Client) Depart(channel string)
func (c *Client) Userlist(channel string) ([]string, error)
func (c *Client) Connect() error
func (c *Client) Disconnect() error

Options

On your client you can configure multiple options:

client.IrcAddress = "127.0.0.1:3030" // for custom irc server
client.TLS = false // enabled by default, will connect to non TLS server of twitch when off or the given client.IrcAddress
client.SetupCmd = "LOGIN custom_command_here" // Send a custom command on successful IRC connection, before authentication.
client.Capabilities = []string{twitch.TagsCapability, twitch.CommandsCapability} // Customize which capabilities are sent

Option modifications must be done before calling Connect on the client.

Capabilities

By default, the client sends along all 3 Twitch capabilities (Tags, Commands, Membership).

Callbacks

These callbacks are available to pass to the client:

client.OnConnect(func() {})
client.OnPrivateMessage(func(message PrivateMessage) {})
client.OnWhisperMessage(func(message WhisperMessage) {})
client.OnClearChatMessage(func(message ClearChatMessage) {})
client.OnClearMessage(func(message ClearMessage) {})
client.OnRoomStateMessage(func(message RoomStateMessage) {})
client.OnUserNoticeMessage(func(message UserNoticeMessage) {})
client.OnUserStateMessage(func(message UserStateMessage) {})
client.OnGlobalUserStateMessage(func(message GlobalUserStateMessage) {})
client.OnNoticeMessage(func(message NoticeMessage) {})
client.OnUserJoinMessage(func(message UserJoinMessage) {})
client.OnUserPartMessage(func(message UserPartMessage) {})

Message Types

If you ever need more than basic PRIVMSG, this might be for you. These are the message types currently supported:

WHISPER
PRIVMSG
CLEARCHAT
CLEARMSG
ROOMSTATE
USERNOTICE
USERSTATE
GLOBALUSERSTATE
NOTICE
JOIN
PART
Comments
  • Refactor message parsing

    Refactor message parsing

    Resolves #5

    I have included the updated API at the bottom.

    Major Changes

    • Removed stuttering from User
    • Split Message into structs for each message type
    • Change message.Text to message.Message to match Twitch documentation
    • Remove channel from callbacks as message types that are sent in a channel contain this information
    • Remove user from callbacks where the message type doesn't send user data
    • Change OnNewUnsetMessage to send RawMessage. This provides the user with more information, including RawType and Tags, for unsupported message types.
    • Remove ParseMessage
    • Add ERRORMESSAGE MessageType for when we fail to parse a message
    • Move parseMessage functions to methods of message to reduce global functions
    • Added and updated tests

    Questions

    • When you hover over a message struct, it shows the embedded structs, but not the variables they contain. These were initially added to reduce code duplication. Should we move the the variables directly into the message structs for usability?

    image

    • This is mute if we decide to move the variables directly into the message struct. If not, I'm unsure about the name of chatMessage. The others accurately describe the common variables. Any ideas for a better name?
    • At the moment, we send UserNoticeMessage.MsgParams as a map[string]interface{} and convert certain values to ints or bools. Should we continue to do this, or send it as a map[string]string, which is what we get directly from Twitch?

    API

    All of the information available, or relevant, to the users.

    Client

    // User data you receive from TMI
    type User struct {
    	ID          string // Not in USERSTATE
    	Name        string
    	DisplayName string
    	Color       string
    	Badges      map[string]int
    }
    
    // RawMessage data you receive from TMI
    type RawMessage struct {
    	rawMessage
    }
    
    // WhisperMessage data you receive from WHISPER message type
    type WhisperMessage struct {
    	rawMessage
    	userMessage
    }
    
    // PrivateMessage data you receive from PRIVMSG message type
    type PrivateMessage struct {
    	chatMessage
    	userMessage
    	Bits int
    }
    
    // ClearChatMessage data you receive from CLEARCHAT message type
    type ClearChatMessage struct {
    	chatMessage
    	MsgID          string // Clear, Ban, Timeout
    	BanDuration    int
    	TargetUserID   string
    	TargetUsername string
    }
    
    // RoomStateMessage data you receive from ROOMSTATE message type
    type RoomStateMessage struct {
    	roomMessage
    	Language string
    	State    map[string]int
    }
    
    // UserNoticeMessage  data you receive from USERNOTICE message type
    type UserNoticeMessage struct {
    	chatMessage
    	userMessage
    	MsgID     string
    	MsgParams map[string]interface{}
    	SystemMsg string
    }
    
    // UserStateMessage data you receive from the USERSTATE message type
    type UserStateMessage struct {
    	channelMessage
    	EmoteSets []string
    }
    
    // NoticeMessage data you receive from the NOTICE message type
    type NoticeMessage struct {
    	channelMessage
    	MsgID string
    }
    
    // OnNewWhisper attach callback to new whisper
    func (c *Client) OnNewWhisper(callback func(user User, message WhisperMessage)) {
    	c.onNewWhisper = callback
    }
    
    // OnNewMessage attach callback to new standard chat messages
    func (c *Client) OnNewMessage(callback func(user User, message PrivateMessage)) {
    	c.onNewMessage = callback
    }
    
    // OnNewClearchatMessage attach callback to new messages such as timeouts
    func (c *Client) OnNewClearChatMessage(callback func(message ClearChatMessage)) {
    	c.onNewClearchatMessage = callback
    }
    
    // OnNewRoomstateMessage attach callback to new messages such as submode enabled
    func (c *Client) OnNewRoomStateMessage(callback func(message RoomStateMessage)) {
    	c.onNewRoomstateMessage = callback
    }
    
    // OnNewUsernoticeMessage attach callback to new usernotice message such as sub, resub, and raids
    func (c *Client) OnNewUserNoticeMessage(callback func(user User, message UserNoticeMessage)) {
    	c.onNewUsernoticeMessage = callback
    }
    
    // OnNewUserstateMessage attach callback to new userstate
    func (c *Client) OnNewUserStateMessage(callback func(user User, message UserStateMessage)) {
    	c.onNewUserstateMessage = callback
    }
    
    // OnNewNoticeMessage attach callback to new notice message such as hosts
    func (c *Client) OnNewNoticeMessage(callback func(message NoticeMessage)) {
    	c.onNewNoticeMessage = callback
    }
    
    // OnNewUnsetMessage attaches callback to message types we currently don't support
    func (c *Client) OnNewUnsetMessage(callback func(message RawMessage)) {
    	c.onNewUnsetMessage = callback
    }
    
    // OnNewErrorMessage attaches callback to messages that didn't parse properly. Should only be used if you're debugging the message parsing.
    func (c *Client) OnNewErrorMessage(callback func(message RawMessage)) {
    	c.onNewErrorMessage = callback
    }
    

    message.go

    // MessageType different message types possible to receive via IRC
    type MessageType int
    
    const (
    	// ERROR is for messages that didn't parse properly
    	ERROR MessageType = -2
    	// UNSET is for message types we currently don't support
    	UNSET MessageType = -1
    	// WHISPER private messages
    	WHISPER MessageType = 0
    	// PRIVMSG standard chat message
    	PRIVMSG MessageType = 1
    	// CLEARCHAT timeout messages
    	CLEARCHAT MessageType = 2
    	// ROOMSTATE changes like sub mode
    	ROOMSTATE MessageType = 3
    	// USERNOTICE messages like subs, resubs, raids, etc
    	USERNOTICE MessageType = 4
    	// USERSTATE messages
    	USERSTATE MessageType = 5
    	// NOTICE messages like sub mode, host on
    	NOTICE MessageType = 6
    )
    
    type rawMessage struct {
    	Type    MessageType
    	RawType string
    	Raw     string
    	Tags    map[string]string
    	Message string
    }
    
    type channelMessage struct {
    	rawMessage
    	Channel string
    }
    
    type roomMessage struct {
    	channelMessage
    	RoomID string
    }
    
    // Unsure of a better name, but this isn't entirely descriptive of the contents
    type chatMessage struct {
    	roomMessage
    	ID   string // Not in CLEARCHAT
    	Time time.Time
    }
    
    type userMessage struct {
    	Action bool
    	Emotes []*Emote
    }
    
    // Emote twitch emotes
    type Emote struct {
    	Name  string
    	ID    string
    	Count int
    }
    
    opened by IAmFletcher 44
  • Connection not becoming active

    Connection not becoming active

    The message

    :tmi.twitch.tv 001 justinfan123123 :Welcome, GLHF! is somehow not evaluated correctly because Strings.HasPrefix doesn't work on the raw message. Strings.Contains works. Something with the PR #7 must have caused this.

    https://github.com/gempir/go-twitch-irc/blob/master/client.go#L120

    Pushing a quickfix with Strings.Contains for now

    We should do some tests that actually connect to twitch, or need to improve our Mock

    opened by gempir 19
  • Clean up message parsing

    Clean up message parsing

    message parsing in message.go is pretty chaotic and still doesn't full represent all tags from Twitch

    • less global functions
    • more idomatic code
    • improve Message and User structs to get closer to the definition by twitch (https://dev.twitch.tv/docs/v5/guides/irc)
    help wanted refactoring Hacktoberfest 
    opened by gempir 14
  • initialJoins ignores message limits when reconnecting

    initialJoins ignores message limits when reconnecting

    At the moment, we attempt to join all the channels in client.channels when we reconnect to Twitch. This means if a user has already joined 100+ channels, they will exceed their limit without knowing, unless they're a Verified Bot.

    func (c *Client) initialJoins() {
    	// join or rejoin channels on connection
    	c.channelsMtx.RLock()
    	for channel := range c.channels {
    		c.send(fmt.Sprintf("JOIN #%s", channel))
    	}
    	c.channelsMtx.RUnlock()
    }
    

    OnReconnectMessage should send the user the list of the channels they've already joined, and let them handle it. While this does break the API, the user should be in control of any commands that count towards their message limit.

    I'm currently playing around with a solution for #82 that will reduce calls by 20 and solve a majority of use-cases.

    opened by IAmFletcher 12
  • JoinMany func

    JoinMany func

    would be nice to add a .JoinMany(channels ...string) func cram as many channels as possible in 512 bytes and send them each to the server

    kinda bad calling join on each channel when you have a few hundred channels

    opened by tensei 12
  • Test if connection is still alive or reconnect after client lost the network connectivity

    Test if connection is still alive or reconnect after client lost the network connectivity

    First of all, thank you for your great work!

    How can I test if my connection is still alive or reconnect after my client lost the network connectivity.

    If the network connection gets interrupted the client still thinks that the connection is alive. I used the readme example, connected to my channel and turned off the network interface the client was listening on.

    Before the interruption I sent some test messages and the client printed them on screen as expected but not after the reconnection.

    What's the best way to handle such a situation?

    According to the twitch docs [1] their servers send a PING every five minutes. Maybe we can check all x minutes what the difference between the last PING and the current time is, but that seems a bit sloppy.

    [1]https://dev.twitch.tv/docs/irc#connecting-to-twitch-irc

    best regards pfd

    help wanted 
    opened by PatrickFD 12
  • Silently dropping connection

    Silently dropping connection

    I'm also currently having an issue where the connection gets silently dropped after an extended period of time running.

    I saw that https://github.com/gempir/go-twitch-irc/pull/25 was reverted. Was it not successful? What about it didn't work? I would be happy to take a crack at this, I just want to make sure I understand what's been done and why it didn't work.

    I've started by taking a look at the discussion on https://github.com/gempir/go-twitch-irc/issues/19 but was wondering if you had anymore thoughts/insights.

    opened by jrbury 9
  • Implement twitch ratelimits

    Implement twitch ratelimits

    Messages are sent to the newly created rateLimiter instead of to client.send, put into a queue, and then based on the set timer, output to client.send.

    Current default for ratelimits is for unknown bots. (not Verified or Known, and not unlimited.)

    opened by deefdragon 8
  • Implement method to respect rateLimits

    Implement method to respect rateLimits

    Creating this to not bog #128 down discussing implementation.

    The cleanest implementation I can think of on this is to put an optional middleware channel between the Join/Say and c.send. If a rate limit rate is not set, it will skip this and simply use c.send. If one is set, the value gets sent to the middleware.

    Whenever a new message is sent to the receiver, it gets added to a stdlib list, and based on a ticker, is then output to c.send. Only downside is that I don't want to leave a ticker running all the time, so that may require some shenanigans based on connect/disconnect and if messages are ready to be sent to enable/disable/reset.

    Thoughts @gempir

    opened by deefdragon 7
  • Fixed emote parsing from action messages.

    Fixed emote parsing from action messages.

    This small PR fixes emote parsing from /me messages. At the moment if we have text /me Test Kappa, the emote will be parsed from privateMessage.Message = "\u0001ACTION Test Kappa" and after this privateMessage.Message will be overwritten with Test Kappa, so privateMessage.Emotes[0] will have a wrong shift.

    opened by 23rd 7
  • Add client.SetupCmd

    Add client.SetupCmd

    Useful for any scenario where you are connecting to a custom IRC proxy (such as your relaybroker) to send a custom IRC command on connection and before authentication, eg, in the context of relaybroker, the "LOGIN" command.

    opened by aidenwallis 7
  • Know when the join attempt is finished

    Know when the join attempt is finished

    Hey!! 👋 👋

    The client.Join request is a non-blocking request, so there's no way of knowing when it is over (being either successful or not).

    I'd like to know that cause I have a list of channels I want to join, and if there's an error on any of them, like for example when the channel does not exist, or if it is suspended at the moment, I'd like to make it visible on the console. Along with that, I also would like to whenever the join attempt is over, display a message on the console (no matter if it was successful or not), to measure how many channels I'm connected, and how many channels are left, to give a sense of progress and to know when it joined all of them.

    Is there a way of doing that with the current API?

    opened by GabrielDuarteM 5
  • Message Ratelimiter

    Message Ratelimiter

    The client should provide a way to limit the amount of messages to be sent.

    The join ratelimiter already laid the groundwork for this implementation. The idea is to have another client method like

    client.SetMessageRateLimiter and use the same interface for the ratelimiter.

    https://dev.twitch.tv/docs/irc/guide#rate-limits

    opened by gempir 0
  • i/o timeout retries

    i/o timeout retries

    A user was having issues with tcp tials and i/o timeouts, those could maybe be handled more gracefully by go-twitch-irc and retry better.

    time="2021-04-08T06:55:29Z" level=fatal msg="dial tcp: lookup irc.chat.twitch.tv on 10.1.1.1:53: read udp 172.17.0.13:54853->10.1.1.1:53: i/o timeout"
    

    Reference Issue: https://github.com/gempir/justlog/issues/96

    opened by gempir 0
  • Connection scaling

    Connection scaling

    Currently go-twitch-irc uses 1 connection to read mesasges from TMI and write message to TMI.

    It is rarely recommended to go above 100 channels on a single connection. This brings up the question if we should support connection scaling in go-twitch-irc directly which would mean we open more connections depending on how many chats we have joined.

    I think we have discussed this once before and back then we decided this would be better to handle on application level instead of in this library. I'd like to rethink this because this could be a very cool feature and can be reused easily for a lot of projects.

    At first I would only implement a very stupid scaling that would open a new connection each 50 channels and keeps them seperate. Maybe later we could have backup connections and seperate write connections.

    From the client side nothing would change. The interface will be excatly the same and nobody has to adjust anything. Connections will automatically scale after 50 channels.

    enhancement 
    opened by gempir 1
  • Add more tests related to emotes

    Add more tests related to emotes

    test cases: @badge-info=subscriber/53;badges=broadcaster/1,subscriber/48,partner/1;color=#CC44FF;display-name=pajlada;emotes=80481:6-10/93547:12-19;flags=;id=6259eb39-48c7-452e-889c-e9305f08cdb7;mod=0;room-id=11148817;subscriber=1;tmi-sent-ts=1589641611227;turbo=0;user-id=11148817;user-type= :[email protected] PRIVMSG #pajlada :-tags pajaW pajaCool 2 emotes, pajaW and pajaCool

    @badge-info=subscriber/53;badges=broadcaster/1,subscriber/48,partner/1;color=#CC44FF;display-name=pajlada;emotes=80481:16-20/496:22-23/emotesv2_56124b6ee48c47778de1a922e93d7848:6-14;flags=;id=63cac648-b4ed-42d5-925e-8baa50dcd9bf;mod=0;room-id=11148817;subscriber=1;tmi-sent-ts=1589641615436;turbo=0;user-id=11148817;user-type= :[email protected] PRIVMSG #pajlada :-tags pajaPants pajaW :D 2 emotes, pajaPants and pajaW (pajaPants is a bit emote)

    @badge-info=subscriber/53;badges=broadcaster/1,subscriber/48,partner/1;color=#CC44FF;display-name=pajlada;emotes=;flags=;id=86391c31-9efb-4ca8-86d9-79adf54c59f7;mod=0;room-id=11148817;subscriber=1;tmi-sent-ts=1589641624819;turbo=0;user-id=11148817;user-type= :[email protected] PRIVMSG #pajlada :-tags pajaW_BW no emote at all, the code is correct but it wasn't redeemed

    @badge-info=subscriber/53;badges=broadcaster/1,subscriber/48,partner/1;color=#CC44FF;display-name=pajlada;emotes=300653550_TK:6-17;flags=;id=3dd37dd4-3a2c-423c-8862-2051a05e8ac2;mod=0;room-id=11148817;subscriber=1;tmi-sent-ts=1589641641791;turbo=0;user-id=11148817;user-type= :[email protected] PRIVMSG #pajlada :-tags pajaAngry_TK correctly redeemed channel point emote

    Hacktoberfest good-first-issue 
    opened by pajlada 0
  • Non spec compliant unit test

    Non spec compliant unit test

    https://github.com/gempir/go-twitch-irc/blob/1ea7808b29d47893ee3a0081c9885b3ea2cfeeba/test_resources/irctests.json#L205-L215

    In this test, the expected output for the parameters is [""] (single element list, holding an empty string).

    I think the IRC spec disagrees on this: https://tools.ietf.org/html/rfc2812#section-2.3.1 relevant part:

        params     =  *14( SPACE middle ) [ SPACE ":" trailing ]
        middle     =  nospcrlfcl *( ":" / nospcrlfcl )
        nospcrlfcl =  %x01-09 / %x0B-0C / %x0E-1F / %x21-39 / %x3B-FF
                        ; any octet except NUL, CR, LF, " " and ":"
    

    So in essence the space between "middle" parameters is "used up" by the SPACE in the definition of params, and then middle first expects something that is not a space. From my understanding this means that multiple spaces are not allowed between middle parameters, and the IRC test under question should be an error.

    bug Hacktoberfest good-first-issue 
    opened by RAnders00 1
Releases(v3.2.0)
  • v3.2.0(Jun 12, 2022)

    What's Changed

    • Add callbacks for self JOIN/PART messages by @zneix in https://github.com/gempir/go-twitch-irc/pull/182

    New Contributors

    • @zneix made their first contribution in https://github.com/gempir/go-twitch-irc/pull/182

    Full Changelog: https://github.com/gempir/go-twitch-irc/compare/v3.1.0...v3.2.0

    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(May 1, 2022)

    What's Changed

    • Added support for replies by @yannismate in https://github.com/gempir/go-twitch-irc/pull/179

    New Contributors

    • @yannismate made their first contribution in https://github.com/gempir/go-twitch-irc/pull/179

    Full Changelog: https://github.com/gempir/go-twitch-irc/compare/v3.0.0...v3.1.0

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0-beta.2(Jan 12, 2022)

    Breaking changes

    membership capability removed #126 RateLimiter naming changes #172 import path changed to v3

    What's Changed

    • fix #164 and respect ratelimit for bulk joins by @gempir in https://github.com/gempir/go-twitch-irc/pull/165
    • Added support for banning users. by @w3bprinz in https://github.com/gempir/go-twitch-irc/pull/163
    • Ratelimiter Interface and mutex by @gempir in https://github.com/gempir/go-twitch-irc/pull/172
    • remove membership as default capability #128 #126 by @gempir in https://github.com/gempir/go-twitch-irc/pull/174
    • Fix WindowRateLimiter off-by-one error by @pajlada in https://github.com/gempir/go-twitch-irc/pull/173
    • upgrade to v3 by @gempir in https://github.com/gempir/go-twitch-irc/pull/176

    New Contributors

    • @w3bprinz made their first contribution in https://github.com/gempir/go-twitch-irc/pull/163

    Full Changelog: https://github.com/gempir/go-twitch-irc/compare/v2.8.1...v3.0.0-beta.2

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Jan 29, 2022)

    Breaking changes

    membership capability removed #126 RateLimiter naming changes #172 import path changed to v3

    What's Changed

    • fix #164 and respect ratelimit for bulk joins by @gempir in https://github.com/gempir/go-twitch-irc/pull/165
    • Added support for banning users. by @w3bprinz in https://github.com/gempir/go-twitch-irc/pull/163
    • Ratelimiter Interface and mutex by @gempir in https://github.com/gempir/go-twitch-irc/pull/172
    • remove membership as default capability #128 #126 by @gempir in https://github.com/gempir/go-twitch-irc/pull/174
    • Fix WindowRateLimiter off-by-one error by @pajlada in https://github.com/gempir/go-twitch-irc/pull/173
    • upgrade to v3 by @gempir in https://github.com/gempir/go-twitch-irc/pull/176

    New Contributors

    • @w3bprinz made their first contribution in https://github.com/gempir/go-twitch-irc/pull/163

    Full Changelog: https://github.com/gempir/go-twitch-irc/compare/v2.8.1...v3.0.0

    Source code(tar.gz)
    Source code(zip)
  • v2.8.2-beta.1(Dec 19, 2021)

    What's Changed

    • fix #164 and respect ratelimit for bulk joins by @gempir in https://github.com/gempir/go-twitch-irc/pull/165

    Full Changelog: https://github.com/gempir/go-twitch-irc/compare/v2.8.1...v2.8.2-beta.1

    Source code(tar.gz)
    Source code(zip)
  • v2.8.1(Nov 22, 2021)

    What's Changed

    • Handle empty action messages by @gempir in https://github.com/gempir/go-twitch-irc/pull/169

    Full Changelog: https://github.com/gempir/go-twitch-irc/compare/v2.8.0...v2.8.1

    Source code(tar.gz)
    Source code(zip)
  • v2.8.0(Nov 9, 2021)

    What's Changed

    • Added First Message support to Twitch user messages. by @Cidan in https://github.com/gempir/go-twitch-irc/pull/168

    Full Changelog: https://github.com/gempir/go-twitch-irc/compare/v2.7.0...v2.8.0

    Source code(tar.gz)
    Source code(zip)
  • v2.7.0(Sep 12, 2021)

    • Respect join ratelimits #160 - This change is a bit breaking since it will now use the default ratelimits from twitch and might cause your joins to be slower - Use SetRatelimiter with the factory methods CreateVerifiedRateLimiter or CreateUnlimitedRateLimiter to change the limits
    Source code(tar.gz)
    Source code(zip)
  • v2.6.0(Jul 29, 2021)

  • v2.5.0(Oct 16, 2020)

  • v2.4.2(Aug 15, 2020)

  • v2.4.1(Aug 1, 2020)

    • more carefully parse emotes, some special modified emotes could crash the emote parser (repeat) Relevant issue: https://github.com/gempir/go-twitch-irc/issues/140 Relevant PR: https://github.com/gempir/go-twitch-irc/pull/141
    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(Jun 13, 2020)

  • v2.3.1(May 16, 2020)

  • v2.3.0(Mar 29, 2020)

  • v2.2.2(Jan 15, 2020)

    • Parse out a nickname if available in IRC message (#110) @bamnet
    • Fix go-twitch-irc not rejoining channels properly upon reconnecting (#116) @pajlada
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Jul 12, 2019)

  • v2.1.1(Jun 15, 2019)

  • 2.1.0(May 4, 2019)

  • 2.0.1(Apr 27, 2019)

  • 2.0.0(Apr 27, 2019)

    Thanks to @FletcherCodes we now have a lot cleaner API. @pajlada helped out a lot too cleaning up. This was the final PR https://github.com/gempir/go-twitch-irc/pull/96

    https://github.com/gempir/go-twitch-irc/pull/78 here is the big PR from @FletcherCodes where we discussed his changes a lot.

    In Summary (borrowed in part from #78)

    • Message interface for all messages
    • Removed stuttering from User
    • Split Message into structs for each message type
    • Change message.Text to message.Message to match Twitch documentation
    • Remove channel from callbacks as message types that are sent in a channel contain this information
    • Remove user from callbacks where the message type doesn't send user data
    • Change OnNewUnsetMessage to send RawMessage. This provides the user with more information, including RawType and Tags, for unsupported message types.
    • Add ERRORMESSAGE MessageType for when we fail to parse a message

    This release is BREAKING please adjust your code accordingly, we wanted to perfect these changes sooner than later, but not rush it either. This API will be a lot nicer to work with, we think.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Mar 2, 2019)

  • 1.0.1(Feb 18, 2019)

  • 1.0.0(Jan 28, 2019)

    • deleted previous released because of messed up versioning
    • this release contains new ping feature, to keep connections stable thanks to @pajlada
    • API is guaranteed to be stable for 1.*
    Source code(tar.gz)
    Source code(zip)
Owner
gempir
Software-Dev
gempir
ChatRat is a twitch chat bot built in Go that is a dedicated shitpost machine.

ChatRat ChatRat is a twitch chat bot built in Go that is a dedicated shitpost machine. Also does some other things, but for now the main thing is just

Pattycakes 5 Nov 17, 2022
Twitchbot - Go Twitch Bot Api wrapper, with an easy to use interface.

twitchbot Go Twitch Bot Api wrapper, with an easy to use interface. Example package main import ( "twitch/twitchbot" ) func main() { bot := twitch

witer33 2 Jan 8, 2022
IRC, Slack, Telegram and RocketChat bot written in go

go-bot IRC, Slack & Telegram bot written in Go using go-ircevent for IRC connectivity, nlopes/slack for Slack and Syfaro/telegram-bot-api for Telegram

null 765 Nov 12, 2022
The Tenyks IRC bot.

Tenyks is a computer program designed to relay messages between connections to IRC networks and custom built services written in any number of languages.

Kyle Terry 174 Sep 26, 2022
A modern IRC server (daemon/ircd) written in Go.

Oragono is a modern IRC server written in Go. Its core design principles are: Being simple to set up and use Combining the features of an ircd, a serv

Oragono 1.9k Nov 22, 2022
This is my first IRC bot for launch ddos attack, Write on Go language.

This is my first IRC bot for launch ddos attack, Write on Go language. For education purpose only. Please test it on your lab, And i create this for join university in the future not for attack anyone server with out any permission!!!

null 1 Sep 23, 2022
IRC bot for launch ddos attack, Mainly of scan target are IoT device that run linux and open default SSH port

This is my first IRC bot for launch ddos attack, Mainly of scan target are IoT device that run linux and open default SSH port, This bot is write on Go language. For education purpose only. Please test it in your lab. And i create this for join university in the future not for attack anyone server with out any permission!!!

Bozer 12 Nov 18, 2022
Jaken - A general purpose IRC bot featuring user acls and arbitrary plugins

Design principles This bot is based on the premise of a loosely coupling between

Lex van Roon 2 Jul 21, 2022
Client lib for Telegram bot api

Micha Client lib for Telegram bot api. Supports Bot API v2.3.1 (of 4th Dec 2016). Simple echo bot example: package main import ( "log" "git

Andrey 23 Nov 10, 2022
Library for working with golang telegram client + bot based on tdlib. This library was taken from the user Arman92 and changed for the current version of tdlib.

go-tdlib Golang Telegram TdLib JSON bindings Install To install, you need to run inside a docker container (it is given below) go get -u github.com/ka

Rostislav Krivets 22 Oct 30, 2022
Discordo is a lightweight, secure, and feature-rich Discord terminal client.

discordo · [WIP] Discordo is a lightweight, secure, and feature-rich Discord terminal client. It is highly configurable and has a minimalistic user in

null 955 Nov 21, 2022
Golang client for compound.finace api and smart contracts

go-compound WARNING: this code deals with money both by making blockchain calls and returning information that can be used to lose/gain money. Please

bonedaddy 23 Apr 5, 2022
DiscordGo: a Go package that provides low level bindings to the Discord chat client API

DiscordGo DiscordGo is a Go package that provides low level bindings to the Discord chat client API. DiscordGo has nearly complete support for all of

Владислав Черников 1 Dec 14, 2021
Gotgproto - A helper package for Go Telegram Client, i.e. gotd/td

GoTGProto GoTGProto is a helper package for gotd library, It aims to make td's r

Anony 48 Nov 1, 2022
Client to send messages to channels in Slack.

Slack Client A simple client to send messages to channels in Slack. Example package main import { "fmt" slack "github.com/tommzn/go-slack" }

Tommzn 1 Mar 13, 2022
Golang-kraken - Golang client for Kraken API

golang-kraken Golang client for the Kraken API. Getting Started Installing go ge

Anastasia 4 Oct 20, 2022
Bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)

Wim 5.3k Nov 23, 2022
A golang client for the Twitch v3 API - public APIs only (for now)

go-twitch Test CLIENT_ID="<my client ID>" go test -v -cover Usage Example File: package main import ( "log" "os" "github.com/knspriggs/go-twi

Kristian Spriggs 22 Sep 27, 2022
Event-based stateful IRC client framework for Go.

GoIRC Client Framework Acquiring and Building Pretty simple, really: go get github.com/fluffle/goirc/client There is some example code that demonstra

Alex Bee 472 Nov 9, 2022
An account creator/follow bot for twitch.tv

twitch-acc-gen An account creator/follow bot for twitch Reason for release Recently I've been seeing a lot of services pop up for twitch, these servic

post 37 Nov 22, 2022