core

package
v0.0.0-...-7a6d2df Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Configuration for your GoBot "How to wave your hands"

Your very own Gobot "More man than machine"

Talkin'

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// By default, goirc enables this
	DisableFloodProtection bool
	BotName                string
	Hostname               string
	SSL                    bool
	Channels               []string
	Plugins                map[string]map[string]interface{}
}

func ReadConfig

func ReadConfig(filename string) (*Config, error)

type Gobot

type Gobot struct {
	Name   string
	Config *Config
	// contains filtered or unexported fields
}

func CreateGobot

func CreateGobot(config *Config) *Gobot

Create a new Gobot from the given gesture config

func (*Gobot) Connect

func (bot *Gobot) Connect(hostname string) (chan bool, error)

Attempt to connect to IRC!

func (*Gobot) Disconnect

func (bot *Gobot) Disconnect()

Send a disconnect message to your robot

func (*Gobot) Error

func (msg *Gobot) Error(err error) Response

func (*Gobot) KeepGoing

func (msg *Gobot) KeepGoing() Response

func (*Gobot) ListenFor

func (bot *Gobot) ListenFor(pattern string, cb func(Message, []string) Response)

Add a listener that matches incoming messages based on the given regexp. Matched messages and any submatches are returned to the callback.

func (*Gobot) Stop

func (msg *Gobot) Stop() Response

type Message

type Message struct {
	User    string
	Channel string
	Text    string
	// contains filtered or unexported fields
}

func (*Message) Ftfy

func (msg *Message) Ftfy(message string)

func (*Message) Names

func (msg *Message) Names() []string

func (*Message) Reply

func (msg *Message) Reply(message string)

func (*Message) Send

func (msg *Message) Send(message string)

func (*Message) SendPriv

func (msg *Message) SendPriv(message string)

type Response

type Response struct {
	Status Status
	Error  error
}

type Status

type Status int
const (
	Stop Status = iota
	KeepGoing
)

Jump to

Keyboard shortcuts

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