ircon

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2020 License: BSD-2-Clause Imports: 6 Imported by: 2

Documentation

Overview

Package ircon maintains a connection to the Twitch IRC service.

Index

Constants

View Source
const DefaultServer = "wss://irc-ws.chat.twitch.tv/"

DefaultServer is the default Twitch "IRC" server used by e.g. web chat

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Connected()
	Disconnected(err error)
	Message(*irc.Message)
}

A Handler receives events from IRCon.

type IRCon

type IRCon struct {
	Handler Handler
	// contains filtered or unexported fields
}

An IRCon is an automatically reconnecting IRC connection.

func New

func New(nick, passwd string) *IRCon

New creates a new IRCon with the given credentials.

func (*IRCon) Background

func (i *IRCon) Background(ctx context.Context)

Background runs the connection in a background goroutine until ctx is done.

func (*IRCon) Send

func (i *IRCon) Send(s string)

Send sends a message to the currently active IRC connection. If there is no active connection, the message is lost.

type Message

type Message = irc.Message

Message aliases irc.Message for import convenience.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL