irc

package
v0.0.0-...-2e5e40a Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package irc implements IRC handlers for github.com/go-chat-bot/bot

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(c *Config)

Run reads the Config, connect to the specified IRC server and starts the bot. The bot will automatically join all the channels specified in the configuration

func SetUp

func SetUp(c *Config) *bot.Bot

SetUp returns a bot for irc according to the Config, but does not run it. When you are ready to run the bot, call Run(nil). This is useful if you need a pointer to the bot, otherwise you can simply call Run().

func SetUpConn

func SetUpConn(c *Config) (*bot.Bot, *ircevent.Connection)

SetUpConn wraps SetUp and returns ircConn in addition to bot

Types

type Config

type Config struct {
	Server        string   // IRC server:port. Ex: ircevent.freenode.org:7000
	Channels      []string // Channels to connect. Ex: []string{"#go-bot", "#channel mypassword"}
	User          string   // The IRC username the bot will use
	Nick          string   // The nick the bot will use
	RealName      string   // The real name (longer string) the bot will use
	Password      string   // Server password
	UseTLS        bool     // Should connect using TLS?
	TLSServerName string   // Must supply if UseTLS is true
	Debug         bool     // This will log all IRC communication to standad output
}

Config must contain the necessary data to connect to an IRC server

Jump to

Keyboard shortcuts

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