Generate MessageReactionRemoveAll handler.

This commit is contained in:
Chris Rhodes 2017-04-15 11:14:39 -07:00
parent db909b14fa
commit 691040e745

View file

@ -34,6 +34,7 @@ const (
messageDeleteBulkEventType = "MESSAGE_DELETE_BULK"
messageReactionAddEventType = "MESSAGE_REACTION_ADD"
messageReactionRemoveEventType = "MESSAGE_REACTION_REMOVE"
messageReactionRemoveAllEventType = "MESSAGE_REACTION_REMOVE_ALL"
messageUpdateEventType = "MESSAGE_UPDATE"
presenceUpdateEventType = "PRESENCE_UPDATE"
presencesReplaceEventType = "PRESENCES_REPLACE"
@ -575,6 +576,26 @@ func (eh messageReactionRemoveEventHandler) Handle(s *Session, i interface{}) {
}
}
// messageReactionRemoveAllEventHandler is an event handler for MessageReactionRemoveAll events.
type messageReactionRemoveAllEventHandler func(*Session, *MessageReactionRemoveAll)
// Type returns the event type for MessageReactionRemoveAll events.
func (eh messageReactionRemoveAllEventHandler) Type() string {
return messageReactionRemoveAllEventType
}
// New returns a new instance of MessageReactionRemoveAll.
func (eh messageReactionRemoveAllEventHandler) New() interface{} {
return &MessageReactionRemoveAll{}
}
// Handle is the handler for MessageReactionRemoveAll events.
func (eh messageReactionRemoveAllEventHandler) Handle(s *Session, i interface{}) {
if t, ok := i.(*MessageReactionRemoveAll); ok {
eh(s, t)
}
}
// messageUpdateEventHandler is an event handler for MessageUpdate events.
type messageUpdateEventHandler func(*Session, *MessageUpdate)
@ -908,6 +929,8 @@ func handlerForInterface(handler interface{}) EventHandler {
return messageReactionAddEventHandler(v)
case func(*Session, *MessageReactionRemove):
return messageReactionRemoveEventHandler(v)
case func(*Session, *MessageReactionRemoveAll):
return messageReactionRemoveAllEventHandler(v)
case func(*Session, *MessageUpdate):
return messageUpdateEventHandler(v)
case func(*Session, *PresenceUpdate):
@ -966,6 +989,7 @@ func init() {
registerInterfaceProvider(messageDeleteBulkEventHandler(nil))
registerInterfaceProvider(messageReactionAddEventHandler(nil))
registerInterfaceProvider(messageReactionRemoveEventHandler(nil))
registerInterfaceProvider(messageReactionRemoveAllEventHandler(nil))
registerInterfaceProvider(messageUpdateEventHandler(nil))
registerInterfaceProvider(presenceUpdateEventHandler(nil))
registerInterfaceProvider(presencesReplaceEventHandler(nil))