From 340b7ee1ae044d5d38d18fd07868ce9524c0bf38 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 18 Mar 2013 17:29:19 -0400 Subject: [PATCH] Cleanup --- plugins/your.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/your.go b/plugins/your.go index 1505344..c9eb9ef 100644 --- a/plugins/your.go +++ b/plugins/your.go @@ -1,9 +1,9 @@ package plugins import ( - "fmt" "math/rand" "strings" + "time" "bitbucket.org/phlyingpenguin/godeepintir/bot" ) @@ -23,14 +23,12 @@ func NewYourPlugin(bot *bot.Bot) *YourPlugin { // This function returns true if the plugin responds in a meaningful way to the users message. // Otherwise, the function returns false and the bot continues execution of other plugins. func (p *YourPlugin) Message(message bot.Message) bool { - fmt.Println("Your got a message!") lower := strings.ToLower(message.Body) if strings.Contains(lower, "your") || strings.Contains(lower, "you're") { if rand.Float64() < 0.2 { r := strings.NewReplacer("Your", "You're", "your", "you're", "You're", "Your", "you're", "your", "Youre", "Your", "youre", "your") msg := r.Replace(message.Body) - fmt.Println(msg) p.Bot.SendMessage(message.Channel, msg) return true }