diff --git a/main.go b/main.go index 69b04d9..97b9960 100644 --- a/main.go +++ b/main.go @@ -46,7 +46,7 @@ func main() { // b.AddHandler("first", plugins.NewFirstPlugin(b)) b.AddHandler("leftpad", leftpad.New(b)) b.AddHandler("downtime", downtime.NewDowntimePlugin(b)) - b.AddHandler("talker", talker.NewTalkerPlugin(b)) + b.AddHandler("talker", talker.New(b)) b.AddHandler("dice", dice.NewDicePlugin(b)) b.AddHandler("beers", beers.NewBeersPlugin(b)) b.AddHandler("counter", counter.NewCounterPlugin(b)) diff --git a/plugins/talker/talker.go b/plugins/talker/talker.go index 2236078..ba3f79d 100644 --- a/plugins/talker/talker.go +++ b/plugins/talker/talker.go @@ -12,7 +12,7 @@ import ( ) var goatse []string = []string{ - "* g o a t s e x * g o a t s e x * g o a t s e x *", + "```* g o a t s e x * g o a t s e x * g o a t s e x *", "g g", "o / \\ \\ / \\ o", "a| | \\ | | a", @@ -36,7 +36,7 @@ var goatse []string = []string{ "s | / / \\__/\\___/ | |s", "e | / | | | |e", "x | | | | | |x", - "* g o a t s e x * g o a t s e x * g o a t s e x *", + "* g o a t s e x * g o a t s e x * g o a t s e x *```", } type TalkerPlugin struct { @@ -44,7 +44,7 @@ type TalkerPlugin struct { enforceNicks bool } -func NewTalkerPlugin(bot *bot.Bot) *TalkerPlugin { +func New(bot *bot.Bot) *TalkerPlugin { return &TalkerPlugin{ Bot: bot, enforceNicks: bot.Config.EnforceNicks, @@ -69,11 +69,13 @@ func (p *TalkerPlugin) Message(message bot.Message) bool { nick = parts[1] } + output := "" for _, line := range goatse { nick = fmt.Sprintf("%9.9s", nick) line = strings.Replace(line, "{nick}", nick, 1) - p.Bot.SendMessage(channel, line) + output += line + "\n" } + p.Bot.SendMessage(channel, output) return true }