irc

package module
v0.0.0-...-3ba4c20 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 16 Imported by: 0

README

go-irc

IRC (IRDille Robot Conversationnel) library in Golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SyntaxError

func SyntaxError(error string) *syntaxError

Types

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

func NewBot

func NewBot(description string) *Bot

func (*Bot) AddCommands

func (b *Bot) AddCommands(c ...Command)

func (*Bot) AddMedias

func (b *Bot) AddMedias(m ...Media)

func (*Bot) AddStream

func (b *Bot) AddStream(r io.Reader, w io.Writer)

func (*Bot) AddURL

func (b *Bot) AddURL(url string)

func (*Bot) AddURLStreamTCP

func (b *Bot) AddURLStreamTCP(host string, port int, tls bool)

func (*Bot) Send

func (b *Bot) Send(sendID string, message string) bool

func (*Bot) Start

func (b *Bot) Start()

type Command

type Command struct {
	Callback    func(Request) (string, error)
	Names       []string
	Syntax      string
	Description string
	ArgFunc     func(count int) bool
}

type IrdilleChannel

type IrdilleChannel struct {
	Name    string
	Key     string
	ShowKey bool
	// contains filtered or unexported fields
}

type IrdilleMedia

type IrdilleMedia struct {
	Host             string
	Port             int
	Tls              bool
	TlsConfig        *tls.Config
	Password         string
	ChannelNames     []string
	Channels         []IrdilleChannel
	Nick             string
	Username         string
	ReconnectDelay   time.Duration
	NewNick          func(nick string) string
	PrivMsgIgnored   bool
	Dcc              func() (ip string, port int)
	OnJoin           func(req *IrdilleRequest)
	OnChannelMessage func(req *IrdilleRequest, response string) // response is the bot optional response to the message through commands
	OnSending        func(message string) string
	// contains filtered or unexported fields
}

type IrdilleRequest

type IrdilleRequest struct {
	Channel    string // "" means private message
	Nick       string
	Host       string
	Username   string
	Registered bool
	// contains filtered or unexported fields
}

func (*IrdilleRequest) Args

func (r *IrdilleRequest) Args() []string

func (*IrdilleRequest) ArgsIndex

func (r *IrdilleRequest) ArgsIndex() []int

func (*IrdilleRequest) Bot

func (r *IrdilleRequest) Bot() *Bot

func (*IrdilleRequest) Command

func (r *IrdilleRequest) Command() string

func (*IrdilleRequest) Message

func (r *IrdilleRequest) Message() string

func (*IrdilleRequest) Name

func (r *IrdilleRequest) Name() string

func (*IrdilleRequest) SendID

func (r *IrdilleRequest) SendID() string

func (*IrdilleRequest) UserID

func (r *IrdilleRequest) UserID() string

type Media

type Media interface {
	// contains filtered or unexported methods
}

type Request

type Request interface {
	Bot() *Bot
	Command() string
	Args() []string
	ArgsIndex() []int
	Message() string
	UserID() string // globally unique username
	Name() string   // friendly user display name
	SendID() string // globally unique ID to send messages back later with Send()
	// contains filtered or unexported methods
}

type StreamMedia

type StreamMedia struct {
	URL string
}

type StreamRequest

type StreamRequest struct {
	// contains filtered or unexported fields
}

func (*StreamRequest) Args

func (r *StreamRequest) Args() []string

func (*StreamRequest) ArgsIndex

func (r *StreamRequest) ArgsIndex() []int

func (*StreamRequest) Bot

func (r *StreamRequest) Bot() *Bot

func (*StreamRequest) Command

func (r *StreamRequest) Command() string

func (*StreamRequest) Message

func (r *StreamRequest) Message() string

func (*StreamRequest) Name

func (r *StreamRequest) Name() string

func (*StreamRequest) SendID

func (r *StreamRequest) SendID() string

func (*StreamRequest) UserID

func (r *StreamRequest) UserID() string

type TelegramMedia

type TelegramMedia struct {
	APIKey string
	// contains filtered or unexported fields
}

type TelegramRequest

type TelegramRequest struct {
	Username string
	// contains filtered or unexported fields
}

func (*TelegramRequest) Args

func (r *TelegramRequest) Args() []string

func (*TelegramRequest) ArgsIndex

func (r *TelegramRequest) ArgsIndex() []int

func (*TelegramRequest) Bot

func (r *TelegramRequest) Bot() *Bot

func (*TelegramRequest) Command

func (r *TelegramRequest) Command() string

func (*TelegramRequest) Message

func (r *TelegramRequest) Message() string

func (*TelegramRequest) Name

func (r *TelegramRequest) Name() string

func (*TelegramRequest) SendID

func (r *TelegramRequest) SendID() string

func (*TelegramRequest) UserID

func (r *TelegramRequest) UserID() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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