pepebot/discord/middleware.go

12 lines
299 B
Go
Raw Normal View History

2021-06-03 13:45:07 +02:00
package main
import "github.com/bwmarrin/discordgo"
func (app *application) LogToConsole(next Command) Command {
fn := func(s *discordgo.Session, m *discordgo.MessageCreate) {
2021-06-03 14:07:11 +02:00
app.infoLog.Printf("%s \tsaid: %s\n", m.Author.Username, m.Content)
2021-06-03 13:45:07 +02:00
next.Execute(s, m)
}
return HandlerFunc(fn)
}