Skip to content

james-bowman/talbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Talbot

Build Status Stack Share

Talbot is a basic chat bot (robot) written in Go that listens and responds to Slack messages.

To make use of Talbot, you will need to setup a user account or a 'bot' user (a special kind of user account specifically designed for programatic access to APIs) and obtain an authentication token from Slack.

Once you have a user account and an authentication token you can connect Talbot to slack. Simply paste the authentication token into the slack.token file in the same directory as the executable.

Talbot can be given any name within Slack - he will use and respond to whatever nick/username is registered for the bot account within Slack. For the purposes of the examples below, we have assumed talbot has been used as the nick in Slack.

Talbot can be extended by registering additional actions as follows.

package main

import "github.com/james-bowman/talbot/brain"

func init() {
	brain.Register(brain.Action{
    		Regex: regexp.MustCompile("(?i)open the pod bay doors"),
	    	Usage: "open the pod bay doors",
			Description: "Opens the bay doors", 
    		Answerer: func(dummy string) string {
    			return "I'm sorry Dave, I can't do that right now."
			},
	})
}

This registers an action that will be executed when any user directs the message open the pod bay doors at the bot i.e.

@talbot: open the pod bay doors

in an open channel or simply

open the pod bay doors

as a Direct Message to Talbot.

Out of the box, Talbot supports the following commands:

  • help - Reply with instructions
  • ping - Reply with pong
  • hello - Reply with a random greeting
  • the rules - Make sure talbot knows the rules
  • image me <search expression> - Queries Google Images and returns a random matching image
  • animate me <search expression> - Like animate me except looks for animated GIFs
  • mustache me <seach expression or URL> - Adds a mustache to the image matched by Google Image search or to the image explicitly specified by URL.

About

Basic chat bot for Slack written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages