Beispiel #1
0
func Init() {
	bot.PluginFunc(randPlugin)
	bot.PluginFunc(decidePlugin)

	bot.CommandFunc(randCmd, "rand", "rand <range>  -- "+
		"choose a random number in range [lo-]hi")
	bot.CommandFunc(decideCmd, "decide", "decide <options>  -- "+
		"choose one of the (space, pipe, quote) delimited options at random")
}
Beispiel #2
0
func Init() {
	rc = reminders.Init()

	// Set up the handlers and commands.
	bot.HandleFunc(load, "connected")
	bot.HandleFunc(tellCheck, "privmsg", "action", "join", "nick")

	bot.CommandFunc(tell, "tell", "tell <nick> <msg>  -- "+
		"Stores a message for the (absent) nick.")
	bot.CommandFunc(list, "remind list",
		"remind list  -- Lists reminders set by or for your nick.")
	bot.CommandFunc(del, "remind del",
		"remind del <N>  -- Deletes (previously listed) reminder N.")
	bot.CommandFunc(set, "remind", "remind <nick> <msg> "+
		"in|at|on <time>  -- Reminds nick about msg at time.")
}
Beispiel #3
0
func Init() {
	mc = markov.Init()

	bot.HandleFunc(recordMarkov, "privmsg")

	bot.CommandFunc(randomCmd, "markov", "markov <user>  -- "+
		"Generate random sentece for given <user>.")
}
Beispiel #4
0
func Init() {
	kc = karma.Init()

	bot.HandleFunc(recordKarma, "privmsg", "action")

	bot.CommandFunc(karmaCmd, "karma", "karma <thing>  -- "+
		"Retrieve the karma score of <thing>.")
}
Beispiel #5
0
func Init() {
	sc = seen.Init()

	bot.HandleFunc(smoke, "privmsg", "action")
	bot.HandleFunc(recordLines, "privmsg", "action")
	bot.HandleFunc(recordPrivmsg, "privmsg", "action")
	bot.HandleFunc(recordJoin, "join", "part")
	bot.HandleFunc(recordNick, "nick", "quit")
	bot.HandleFunc(recordKick, "kick")

	bot.CommandFunc(seenCmd, "seen", "seen <nick> [action]  -- "+
		"display the last time <nick> was seen on IRC [doing action]")
	bot.CommandFunc(lines, "lines", "lines [nick]  -- "+
		"display how many lines you [or nick] has said in the channel")
	bot.CommandFunc(topten, "topten", "topten  -- "+
		"display the nicks who have said the most in the channel")
	bot.CommandFunc(topten, "top10", "top10  -- "+
		"display the nicks who have said the most in the channel")
}
Beispiel #6
0
func Init() {
	qc = quotes.Init()

	bot.PluginFunc(quotePlugin)
	bot.CommandFunc(add, "qadd", "qadd <quote>  -- Adds a quote to the db.")
	bot.CommandFunc(add, "quote add",
		"quote add <quote>  -- Adds a quote to the db.")
	bot.CommandFunc(add, "add quote",
		"add quote <quote>  -- Adds a quote to the db.")
	bot.CommandFunc(del, "qdel", "qdel #<qID>  -- Deletes a quote from the db.")
	bot.CommandFunc(del, "quote del",
		"quote del #<qID>  -- Deletes a quote from the db.")
	bot.CommandFunc(del, "del quote",
		"del quote #<qID>  -- Deletes a quote from the db.")
	bot.CommandFunc(fetch, "quote #", "quote #<qID>  -- Displays quote <qID>.")
	bot.CommandFunc(lookup, "quote",
		"quote <regex>  -- Displays quotes matching <regex>")
}
Beispiel #7
0
func Init() {
	bot.CommandFunc(calculate, "calc", "calc <expr>  -- does maths for you")
	bot.CommandFunc(netmask, "netmask", "netmask <ip/cidr>|<ip> <mask>"+
		"  -- calculate IPv4 / IPv6 netmasks")
	bot.CommandFunc(chr, "chr", "chr <int>  -- "+
		"prints the character represented by <int> in various formats")
	bot.CommandFunc(ord, "ord", "ord <char>  -- "+
		"prints the numeric and UTF-8 representations of <char>")
	bot.CommandFunc(convertBase, "base", "base <from>to<to> <num>  -- "+
		"converts <num> from base <from> to base <to>")
	bot.CommandFunc(length, "length", "length <string>  -- "+
		"prints the length of <string>")
}
Beispiel #8
0
func Init() {
	fc = factoids.Init()

	bot.HandleFunc(insert, "privmsg")
	bot.HandleFunc(lookup, "privmsg", "action")

	bot.PluginFunc(replaceIdentifiers)

	bot.CommandFunc(chance, "chance of that is",
		"chance  -- Sets trigger chance of the last displayed factoid value.")
	bot.CommandFunc(forget, "delete that",
		"delete  -- Forgets the last displayed factoid value.")
	bot.CommandFunc(forget, "forget that",
		"forget  -- Forgets the last displayed factoid value.")
	bot.CommandFunc(info, "fact info",
		"fact info <key>  -- Displays some stats about factoid <key>.")
	bot.CommandFunc(literal, "literal",
		"literal <key>  -- Displays the factoid values stored for <key>.")
	bot.CommandFunc(replace, "replace that with",
		"replace  -- Replaces the last displayed factoid value.")
	bot.CommandFunc(search, "fact search",
		"fact search <regexp>  -- Searches for factoids matching <regexp>.")
}
Beispiel #9
0
func Init() {
	uc = urls.Init()

	if err := os.MkdirAll(*urlCacheDir, 0700); err != nil {
		logging.Fatal("Couldn't create URL cache dir: %v", err)
	}

	bot.HandleFunc(urlScan, "privmsg")

	bot.CommandFunc(find, "urlfind", "urlfind <regex>  -- "+
		"searches for previously mentioned URLs matching <regex>")
	bot.CommandFunc(find, "url find", "url find <regex>  -- "+
		"searches for previously mentioned URLs matching <regex>")
	bot.CommandFunc(find, "urlsearch", "urlsearch <regex>  -- "+
		"searches for previously mentioned URLs matching <regex>")
	bot.CommandFunc(find, "url search", "url search <regex>  -- "+
		"searches for previously mentioned URLs matching <regex>")

	bot.CommandFunc(find, "randurl", "randurl  -- displays a random URL")
	bot.CommandFunc(find, "random url", "random url  -- displays a random URL")

	bot.CommandFunc(shorten, "shorten that", "shorten that  -- "+
		"shortens the last mentioned URL.")
	bot.CommandFunc(shorten, "shorten", "shorten <url>  -- shortens <url>")

	bot.CommandFunc(cache, "cache that", "cache that  -- "+
		"caches the last mentioned URL.")
	bot.CommandFunc(cache, "cache", "cache <url>  -- caches <url>")
	bot.CommandFunc(cache, "save that", "save that  -- "+
		"caches the last mentioned URL.")
	bot.CommandFunc(cache, "save", "save <url>  -- caches <url>")

	// This serves "shortened" urls
	http.Handle(shortenPath, http.StripPrefix(shortenPath,
		http.HandlerFunc(shortenedServer)))

	// This serves "cached" urls
	http.Handle(cachePath, http.StripPrefix(cachePath,
		http.FileServer(http.Dir(*urlCacheDir))))
}