diff options
author | Wim <wim@42.be> | 2017-07-16 14:38:45 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-07-16 14:38:45 +0200 |
commit | 5db24aa90163839d0deebc4062d84aa4222bd50a (patch) | |
tree | a5eed881ef53a5cc2d3ef6e1eccdd37345ed0880 /vendor/github.com/bwmarrin/discordgo/tools/cmd | |
parent | aec5e3d77b6e480d04dd8773723de62416a94919 (diff) | |
download | matterbridge-msglm-5db24aa90163839d0deebc4062d84aa4222bd50a.tar.gz matterbridge-msglm-5db24aa90163839d0deebc4062d84aa4222bd50a.tar.bz2 matterbridge-msglm-5db24aa90163839d0deebc4062d84aa4222bd50a.zip |
Update vendor (bwmarrin/discordgo)
Diffstat (limited to 'vendor/github.com/bwmarrin/discordgo/tools/cmd')
-rw-r--r-- | vendor/github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go | 7 |
1 files changed, 4 insertions, 3 deletions
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}} } |