websocket_twitch_connection

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PSTFormat = "Jan 2 15:04:05 PST"

Variables

This section is empty.

Functions

func TimeStamp

func TimeStamp(format string) string

the generic variation, for bots using the TwitchBot interface

Types

type TwitchBot

type TwitchBot interface {
	Connect()
	Disconnect()
	HandleChat() error
	JoinChannel()
	Say(msg string) error
	Start()
}

type TwitchProps

type TwitchProps struct {
	Channel string

	MsgRate    time.Duration
	Name       string
	Port       string
	OAuthToken string
	Server     string
	// contains filtered or unexported fields
}

func (*TwitchProps) Connect

func (bb *TwitchProps) Connect()

Connects the bot to the Twitch IRC server. The bot will continue to try to connect until it succeeds or is manually shutdown.

func (*TwitchProps) Disconnect

func (bb *TwitchProps) Disconnect()

Officially disconnects the bot from the Twitch IRC server.

func (*TwitchProps) HandleChat

func (bb *TwitchProps) HandleChat() error

Listens for and logs messages from chat. Responds to commands from the channel owner. The bot continues until it gets disconnected, told to shutdown, or forcefully shutdown.

func (*TwitchProps) JoinChannel

func (bb *TwitchProps) JoinChannel()

Makes the bot join its pre-specified channel.

func (*TwitchProps) Say

func (bb *TwitchProps) Say(msg string) error

Makes the bot send a message to the chat channel.

func (*TwitchProps) Start

func (bb *TwitchProps) Start()

Starts a loop where the bot will attempt to connect to the Twitch IRC server, then connect to the pre-specified channel, and then handle the chat. It will attempt to reconnect until it is told to shut down, or is forcefully shutdown.

Jump to

Keyboard shortcuts

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