Categorygithub.com/zaibon/ircbot
modulepackage
0.1.1
Repository: https://github.com/zaibon/ircbot.git
Documentation: pkg.go.dev

# README

ircbot

Simple irc bot package in Go

Example of implementation can be found at ttps://github.com/zaibon/zbibot

Installation

go get github.com/zaibon/ircbot

Usage

import (
	"github.com/zaibon/ircbot"
	"github.com/zaibon/ircbot/actions"
)


func main(){
	//create new bot
	channels := string[]{
		"go-nuts",
	}
	b := ircbot.NewIrcBot("ircbot", "ircbot", "irc.freenode.net", "6667", channels, "irc.db")

	//add custom intern actions
	b.AddInternAction(&actions.Greet{})
	b.AddInternAction(&actions.TitleExtract{})
	b.AddInternAction(actions.NewLogger(b))
	b.AddInternAction(actions.NewURLLog(b))

	//add command fire by users
	b.AddUserAction(&actions.Help{})

	//connectin to server, listen and serve
	b.Connect(os.Getenv("MY_PASSWORD"))

	//block until we send something to b.Exit channel
	<-b.Exit
	b.Disconnect()
}

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
ParseLine parse a line receive from server and return a new IrcMsg object.

# Structs

IrcBot represents the bot in general.
IrcMsg represent a message receive or send to the irc server.

# Interfaces

Actioner is the interface that objects need to implement custom action for the bot.

# Type aliases

ActionFunc is the type of function used in Actioner.