2020-01-15 04:43:34 +00:00
|
|
|
package gateway
|
|
|
|
|
|
|
|
// Event is any event struct. They have an "Event" suffixed to them.
|
|
|
|
type Event = interface{}
|
|
|
|
|
2020-10-29 02:39:18 +00:00
|
|
|
// EventCreator maps an event type string to a constructor.
|
2020-01-15 04:43:34 +00:00
|
|
|
var EventCreator = map[string]func() Event{
|
2020-11-29 01:22:03 +00:00
|
|
|
"HELLO": func() Event { return new(HelloEvent) },
|
|
|
|
"READY": func() Event { return new(ReadyEvent) },
|
|
|
|
"READY_SUPPLEMENTAL": func() Event { return new(ReadySupplementalEvent) },
|
|
|
|
"RESUMED": func() Event { return new(ResumedEvent) },
|
|
|
|
"INVALID_SESSION": func() Event { return new(InvalidSessionEvent) },
|
2020-01-15 04:43:34 +00:00
|
|
|
|
2020-05-13 00:51:23 +00:00
|
|
|
"CHANNEL_CREATE": func() Event { return new(ChannelCreateEvent) },
|
|
|
|
"CHANNEL_UPDATE": func() Event { return new(ChannelUpdateEvent) },
|
|
|
|
"CHANNEL_DELETE": func() Event { return new(ChannelDeleteEvent) },
|
|
|
|
"CHANNEL_PINS_UPDATE": func() Event { return new(ChannelPinsUpdateEvent) },
|
|
|
|
"CHANNEL_UNREAD_UPDATE": func() Event { return new(ChannelUnreadUpdateEvent) },
|
2020-01-15 04:43:34 +00:00
|
|
|
|
|
|
|
"GUILD_CREATE": func() Event { return new(GuildCreateEvent) },
|
|
|
|
"GUILD_UPDATE": func() Event { return new(GuildUpdateEvent) },
|
|
|
|
"GUILD_DELETE": func() Event { return new(GuildDeleteEvent) },
|
|
|
|
|
|
|
|
"GUILD_BAN_ADD": func() Event { return new(GuildBanAddEvent) },
|
|
|
|
"GUILD_BAN_REMOVE": func() Event { return new(GuildBanRemoveEvent) },
|
|
|
|
|
2020-07-11 07:01:02 +00:00
|
|
|
"GUILD_EMOJIS_UPDATE": func() Event { return new(GuildEmojisUpdateEvent) },
|
|
|
|
"GUILD_INTEGRATIONS_UPDATE": func() Event { return new(GuildIntegrationsUpdateEvent) },
|
2020-01-15 04:43:34 +00:00
|
|
|
|
|
|
|
"GUILD_MEMBER_ADD": func() Event { return new(GuildMemberAddEvent) },
|
|
|
|
"GUILD_MEMBER_REMOVE": func() Event { return new(GuildMemberRemoveEvent) },
|
|
|
|
"GUILD_MEMBER_UPDATE": func() Event { return new(GuildMemberUpdateEvent) },
|
|
|
|
"GUILD_MEMBERS_CHUNK": func() Event { return new(GuildMembersChunkEvent) },
|
|
|
|
|
2020-05-13 00:51:23 +00:00
|
|
|
"GUILD_MEMBER_LIST_UPDATE": func() Event { return new(GuildMemberListUpdate) },
|
2020-03-16 05:55:45 +00:00
|
|
|
|
2020-01-15 04:43:34 +00:00
|
|
|
"GUILD_ROLE_CREATE": func() Event { return new(GuildRoleCreateEvent) },
|
|
|
|
"GUILD_ROLE_UPDATE": func() Event { return new(GuildRoleUpdateEvent) },
|
|
|
|
"GUILD_ROLE_DELETE": func() Event { return new(GuildRoleDeleteEvent) },
|
|
|
|
|
2020-05-13 00:51:23 +00:00
|
|
|
"INVITE_CREATE": func() Event { return new(InviteCreateEvent) },
|
|
|
|
"INVITE_DELETE": func() Event { return new(InviteDeleteEvent) },
|
|
|
|
|
2020-01-15 04:43:34 +00:00
|
|
|
"MESSAGE_CREATE": func() Event { return new(MessageCreateEvent) },
|
|
|
|
"MESSAGE_UPDATE": func() Event { return new(MessageUpdateEvent) },
|
|
|
|
"MESSAGE_DELETE": func() Event { return new(MessageDeleteEvent) },
|
|
|
|
"MESSAGE_DELETE_BULK": func() Event { return new(MessageDeleteBulkEvent) },
|
|
|
|
|
2020-10-29 02:39:18 +00:00
|
|
|
"MESSAGE_REACTION_ADD": func() Event { return new(MessageReactionAddEvent) },
|
|
|
|
"MESSAGE_REACTION_REMOVE": func() Event { return new(MessageReactionRemoveEvent) },
|
|
|
|
"MESSAGE_REACTION_REMOVE_ALL": func() Event { return new(MessageReactionRemoveAllEvent) },
|
|
|
|
"MESSAGE_REACTION_REMOVE_EMOJI": func() Event { return new(MessageReactionRemoveEmojiEvent) },
|
2020-01-15 04:43:34 +00:00
|
|
|
|
2020-02-16 05:29:25 +00:00
|
|
|
"MESSAGE_ACK": func() Event { return new(MessageAckEvent) },
|
|
|
|
|
|
|
|
"PRESENCE_UPDATE": func() Event { return new(PresenceUpdateEvent) },
|
|
|
|
"PRESENCES_REPLACE": func() Event { return new(PresencesReplaceEvent) },
|
2020-02-23 17:56:16 +00:00
|
|
|
"SESSIONS_REPLACE": func() Event { return new(SessionsReplaceEvent) },
|
2020-02-16 05:29:25 +00:00
|
|
|
|
|
|
|
"TYPING_START": func() Event { return new(TypingStartEvent) },
|
2020-01-15 04:43:34 +00:00
|
|
|
|
|
|
|
"VOICE_STATE_UPDATE": func() Event { return new(VoiceStateUpdateEvent) },
|
|
|
|
"VOICE_SERVER_UPDATE": func() Event { return new(VoiceServerUpdateEvent) },
|
2020-01-24 06:35:50 +00:00
|
|
|
|
2020-01-25 05:24:33 +00:00
|
|
|
"WEBHOOKS_UPDATE": func() Event { return new(WebhooksUpdateEvent) },
|
2020-02-16 05:29:25 +00:00
|
|
|
|
2021-01-27 17:43:38 +00:00
|
|
|
"INTERACTION_CREATE": func() Event { return new(InteractionCreateEvent) },
|
|
|
|
|
2020-07-11 07:01:02 +00:00
|
|
|
"USER_UPDATE": func() Event { return new(UserUpdateEvent) },
|
|
|
|
"USER_SETTINGS_UPDATE": func() Event { return new(UserSettingsUpdateEvent) },
|
|
|
|
"USER_GUILD_SETTINGS_UPDATE": func() Event { return new(UserGuildSettingsUpdateEvent) },
|
|
|
|
"USER_NOTE_UPDATE": func() Event { return new(UserNoteUpdateEvent) },
|
|
|
|
|
|
|
|
"RELATIONSHIP_ADD": func() Event { return new(RelationshipAddEvent) },
|
|
|
|
"RELATIONSHIP_REMOVE": func() Event { return new(RelationshipRemoveEvent) },
|
2020-01-15 04:43:34 +00:00
|
|
|
}
|