From 5db24aa90163839d0deebc4062d84aa4222bd50a Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 16 Jul 2017 14:38:45 +0200 Subject: Update vendor (bwmarrin/discordgo) --- .../github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'vendor/github.com/bwmarrin/discordgo/tools/cmd') diff --git a/vendor/github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go b/vendor/github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go index f3894085..839f009d 100644 --- a/vendor/github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go +++ b/vendor/github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go @@ -37,18 +37,18 @@ type {{privateName .}}EventHandler func(*Session, *{{.}}) func (eh {{privateName .}}EventHandler) Type() string { return {{privateName .}}EventType } - +{{if isDiscordEvent .}} // New returns a new instance of {{.}}. func (eh {{privateName .}}EventHandler) New() interface{} { return &{{.}}{} -} - +}{{end}} // Handle is the handler for {{.}} events. func (eh {{privateName .}}EventHandler) Handle(s *Session, i interface{}) { if t, ok := i.(*{{.}}); ok { eh(s, t) } } + {{end}} func handlerForInterface(handler interface{}) EventHandler { switch v := handler.(type) { @@ -60,6 +60,7 @@ func handlerForInterface(handler interface{}) EventHandler { return nil } + func init() { {{range .}}{{if isDiscordEvent .}} registerInterfaceProvider({{privateName .}}EventHandler(nil)){{end}}{{end}} } -- cgit v1.2.3