irc

package
v0.0.0-...-d0bd67e Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package irc is used for twitch's irc

Package irc is used for twitch's irc

Package irc is used for twitch's irc

Index

Constants

View Source
const AppName string = "goPurple/irc"

AppName is the name of the application

FullVersion contains the full name and version of this package in a printable string

View Source
const VersionBuild string = "s"

VersionBuild is the type of this release. s(table), b(eta), d(evelopment), n(ightly)

View Source
const VersionMajor string = "0"

VersionMajor 0 means in development, >1 ensures compatibility with each minor version, but breakes with new major version

View Source
const VersionMinor string = "4"

VersionMinor introduces changes that require a new version number. If the major version is 0, they are likely to break compatibility

Variables

View Source
var ArchiumDataIdentifier = "Message"

ArchiumDataIdentifier is the identifier to find the actual irc message in the archium message

View Source
var ArchiumPrefix = "twitch.irc."

ArchiumPrefix is the prefix used for twitch irc messages on archium

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Username, Host, Port string
	JoinedChannels       []string

	ModOnly bool
	// contains filtered or unexported fields
}

Connection holds everything required for an Irc connection to twitch

func (*Connection) BlockingSend

func (ircConn *Connection) BlockingSend(line, channel string)

BlockingSend sends a message to a channel and blocks until its actually sent within ratelimits

func (*Connection) Connect

func (ircConn *Connection) Connect(ip, port string) error

Connect opens a connection to the irc server

func (*Connection) Init

func (ircConn *Connection) Init(oauth, nick string)

Init initializes the connection and logs in

func (*Connection) Join

func (ircConn *Connection) Join(channel string)

Join joins a channel

func (*Connection) Leave

func (ircConn *Connection) Leave(channel string)

Leave leaves a channel

func (*Connection) Quit

func (ircConn *Connection) Quit()

Quit closes the irc connection

func (*Connection) Reconnect

func (ircConn *Connection) Reconnect()

Reconnect reconnects to the irc server.

func (*Connection) Send

func (ircConn *Connection) Send(line, channel string)

Send sends a message to a channel

func (*Connection) Sendln

func (ircConn *Connection) Sendln(line string)

Sendln sends a raw string to irc. Pls consider using Send instead expect you know what you are doing.

func (*Connection) Wait

func (ircConn *Connection) Wait()

Wait waits until the queue is done and a message to waitingChannel is sent, e.g. the connection is terminated

func (*Connection) WaitForQueue

func (ircConn *Connection) WaitForQueue()

WaitForQueue waits until all queued up irc messages are sent within ratelimits

type Message

type Message struct {
	Tags                               map[string]string
	Raw, Channel, Msg, Command, Source string
}

Message contains an irc message

func Parse

func Parse(line string) *Message

Parse parses an irc message

type TwitchIRCListener

type TwitchIRCListener struct {
	ArchiumDataIdentifier, ArchiumPrefix string
	IrcConn                              *Connection
}

TwitchIRCListener is a listener that matches general irc messages on twitch like PING or RECONNECT

func (*TwitchIRCListener) GetTypes

func (til *TwitchIRCListener) GetTypes() []string

GetTypes returns the twitch irc prefix for archium

func (*TwitchIRCListener) Trigger

func (til *TwitchIRCListener) Trigger(ae archium.Event)

Trigger handles PING and RECONNECT

Jump to

Keyboard shortcuts

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