Home

Awesome

Circle CI

Active

Tip: Use !help <command> to obtaing more info about these commands.

Passive (triggers)

Passive commands receive all the text sent to the bot or the channels that the bot is in and can process it and reply.

These commands differ from the active commands as they are executed for every text that the bot receives. Ex: The Chuck Norris command, replies with a Chuck Norris fact every time the words "chuck" or "norris" are mentioned on a channel.

Periodic (triggers)

Periodic commands are run based on a cron specification passed to the config. These commands are runned periodically, outputting a message to the configured channel(s).

Look into the good morning example command for guidance on how to write and configure periodic commands.

Wish to write a new plugin?

Start with the example commands in the example directory.

It's dead simple, you just need to write a go function and register it on the bot.

Here's a Hello World plugin example:

package example

import (
	"fmt"

	"github.com/go-chat-bot/bot"
)

func hello(command *bot.Cmd) (msg string, err error) {
	msg = fmt.Sprintf("Hello %s", command.User.RealName)
	return
}

func init() {
	bot.RegisterCommand(
		"hello",
		"Sends a 'Hello' message to you on the channel.",
		"",
		hello)
}