twitch_chat_bot

package module
v0.0.0-...-1a60180 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 9 Imported by: 0

README

twitch_chat_bot

An app to connect with chat by channel twitch

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 BasicBot

type BasicBot struct {
	Channel string

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

func (*BasicBot) Connect

func (bb *BasicBot) 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 (*BasicBot) Disconnect

func (bb *BasicBot) Disconnect()

Officially disconnects the bot from the Twitch IRC server.

func (*BasicBot) HandleChat

func (bb *BasicBot) 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 (*BasicBot) JoinChannel

func (bb *BasicBot) JoinChannel()

Makes the bot join its pre-specified channel.

func (*BasicBot) Say

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

Makes the bot send a message to the chat channel.

func (*BasicBot) Start

func (bb *BasicBot) 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.

type TwitchBot

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

Jump to

Keyboard shortcuts

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