pepebot/discord/middleware.go
2021-06-03 13:45:07 +02:00

12 lines
301 B
Go

package main
import "github.com/bwmarrin/discordgo"
func (app *application) LogToConsole(next Command) Command {
fn := func(s *discordgo.Session, m *discordgo.MessageCreate) {
app.infoLog.Printf("%s \tsaid: %s\n", m.Author.Username, m.Content)
next.Execute(s, m)
}
return HandlerFunc(fn)
}