From 31d52248d7982a82ff7de4d60fa631a00f6bb02e Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Fri, 17 Aug 2012 23:11:36 -0400 Subject: [PATCH] Improved channel handling to allow /QUREY use of the bot --- bot/handlers.go | 3 +++ plugins/beers.go | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bot/handlers.go b/bot/handlers.go index 55b6d99..a877f0d 100644 --- a/bot/handlers.go +++ b/bot/handlers.go @@ -91,6 +91,9 @@ func (b *Bot) MsgRecieved(conn *irc.Conn, line *irc.Line) { user := b.checkuser(line.Nick) channel := line.Args[0] + if channel == conn.Me.Nick { + channel = line.Nick + } message := line.Args[1] iscmd := false iscmd, message = b.isCmd(message) diff --git a/plugins/beers.go b/plugins/beers.go index 813c54a..bcd97c2 100644 --- a/plugins/beers.go +++ b/plugins/beers.go @@ -137,7 +137,10 @@ func (p *BeersPlugin) LoadData() { // Help responds to help requests. Every plugin must implement a help function. func (p *BeersPlugin) Help(channel string, parts []string) { - p.Bot.SendMessage(channel, "Sorry, Beers does not do a goddamn thing.") + msg := "Beers: imbibe by using either beers +=,=,++ or with the !imbibe/drink " + + "commands. I'll keep a count of how many beers you've had and then if you want " + + "to reset, just !puke it all up!" + p.Bot.SendMessage(channel, msg) } func (p *BeersPlugin) setBeers(user *bot.User, amount int) {