Gateway: Added new InviteCreateEvent and InviteDeleteEvent
This commit is contained in:
parent
91bc93f331
commit
adb23eeb8e
|
@ -171,6 +171,28 @@ func (u GuildMemberUpdateEvent) Update(m *discord.Member) {
|
||||||
m.Nick = u.Nick
|
m.Nick = u.Nick
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/topics/gateway#invites
|
||||||
|
type (
|
||||||
|
InviteCreateEvent struct {
|
||||||
|
Code string `json:"code"`
|
||||||
|
CreatedAt discord.Timestamp `json:"created_at"`
|
||||||
|
ChannelID discord.Snowflake `json:"channel_id"`
|
||||||
|
GuildID discord.Snowflake `json:"guild_id,omitempty"`
|
||||||
|
|
||||||
|
// Similar to discord.Invite
|
||||||
|
Inviter *discord.User `json:"inviter,omitempty"`
|
||||||
|
Target *discord.User `json:"target_user,omitempty"`
|
||||||
|
TargetType discord.InviteUserType `json:"target_user_type,omitempty"`
|
||||||
|
|
||||||
|
discord.InviteMetadata
|
||||||
|
}
|
||||||
|
InviteDeleteEvent struct {
|
||||||
|
Code string `json:"code"`
|
||||||
|
ChannelID discord.Snowflake `json:"channel_id"`
|
||||||
|
GuildID discord.Snowflake `json:"guild_id,omitempty"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// https://discordapp.com/developers/docs/topics/gateway#messages
|
// https://discordapp.com/developers/docs/topics/gateway#messages
|
||||||
type (
|
type (
|
||||||
MessageCreateEvent struct {
|
MessageCreateEvent struct {
|
||||||
|
|
|
@ -13,9 +13,7 @@ var EventCreator = map[string]func() Event{
|
||||||
"CHANNEL_UPDATE": func() Event { return new(ChannelUpdateEvent) },
|
"CHANNEL_UPDATE": func() Event { return new(ChannelUpdateEvent) },
|
||||||
"CHANNEL_DELETE": func() Event { return new(ChannelDeleteEvent) },
|
"CHANNEL_DELETE": func() Event { return new(ChannelDeleteEvent) },
|
||||||
"CHANNEL_PINS_UPDATE": func() Event { return new(ChannelPinsUpdateEvent) },
|
"CHANNEL_PINS_UPDATE": func() Event { return new(ChannelPinsUpdateEvent) },
|
||||||
"CHANNEL_UNREAD_UPDATE": func() Event {
|
"CHANNEL_UNREAD_UPDATE": func() Event { return new(ChannelUnreadUpdateEvent) },
|
||||||
return new(ChannelUnreadUpdateEvent)
|
|
||||||
},
|
|
||||||
|
|
||||||
"GUILD_CREATE": func() Event { return new(GuildCreateEvent) },
|
"GUILD_CREATE": func() Event { return new(GuildCreateEvent) },
|
||||||
"GUILD_UPDATE": func() Event { return new(GuildUpdateEvent) },
|
"GUILD_UPDATE": func() Event { return new(GuildUpdateEvent) },
|
||||||
|
@ -34,28 +32,23 @@ var EventCreator = map[string]func() Event{
|
||||||
"GUILD_MEMBER_UPDATE": func() Event { return new(GuildMemberUpdateEvent) },
|
"GUILD_MEMBER_UPDATE": func() Event { return new(GuildMemberUpdateEvent) },
|
||||||
"GUILD_MEMBERS_CHUNK": func() Event { return new(GuildMembersChunkEvent) },
|
"GUILD_MEMBERS_CHUNK": func() Event { return new(GuildMembersChunkEvent) },
|
||||||
|
|
||||||
"GUILD_MEMBER_LIST_UPDATE": func() Event {
|
"GUILD_MEMBER_LIST_UPDATE": func() Event { return new(GuildMemberListUpdate) },
|
||||||
return new(GuildMemberListUpdate)
|
|
||||||
},
|
|
||||||
|
|
||||||
"GUILD_ROLE_CREATE": func() Event { return new(GuildRoleCreateEvent) },
|
"GUILD_ROLE_CREATE": func() Event { return new(GuildRoleCreateEvent) },
|
||||||
"GUILD_ROLE_UPDATE": func() Event { return new(GuildRoleUpdateEvent) },
|
"GUILD_ROLE_UPDATE": func() Event { return new(GuildRoleUpdateEvent) },
|
||||||
"GUILD_ROLE_DELETE": func() Event { return new(GuildRoleDeleteEvent) },
|
"GUILD_ROLE_DELETE": func() Event { return new(GuildRoleDeleteEvent) },
|
||||||
|
|
||||||
|
"INVITE_CREATE": func() Event { return new(InviteCreateEvent) },
|
||||||
|
"INVITE_DELETE": func() Event { return new(InviteDeleteEvent) },
|
||||||
|
|
||||||
"MESSAGE_CREATE": func() Event { return new(MessageCreateEvent) },
|
"MESSAGE_CREATE": func() Event { return new(MessageCreateEvent) },
|
||||||
"MESSAGE_UPDATE": func() Event { return new(MessageUpdateEvent) },
|
"MESSAGE_UPDATE": func() Event { return new(MessageUpdateEvent) },
|
||||||
"MESSAGE_DELETE": func() Event { return new(MessageDeleteEvent) },
|
"MESSAGE_DELETE": func() Event { return new(MessageDeleteEvent) },
|
||||||
"MESSAGE_DELETE_BULK": func() Event { return new(MessageDeleteBulkEvent) },
|
"MESSAGE_DELETE_BULK": func() Event { return new(MessageDeleteBulkEvent) },
|
||||||
|
|
||||||
"MESSAGE_REACTION_ADD": func() Event {
|
"MESSAGE_REACTION_ADD": func() Event { return new(MessageReactionAddEvent) },
|
||||||
return new(MessageReactionAddEvent)
|
"MESSAGE_REACTION_REMOVE": func() Event { return new(MessageReactionRemoveEvent) },
|
||||||
},
|
"MESSAGE_REACTION_REMOVE_ALL": func() Event { return new(MessageReactionRemoveAllEvent) },
|
||||||
"MESSAGE_REACTION_REMOVE": func() Event {
|
|
||||||
return new(MessageReactionRemoveEvent)
|
|
||||||
},
|
|
||||||
"MESSAGE_REACTION_REMOVE_ALL": func() Event {
|
|
||||||
return new(MessageReactionRemoveAllEvent)
|
|
||||||
},
|
|
||||||
|
|
||||||
"MESSAGE_ACK": func() Event { return new(MessageAckEvent) },
|
"MESSAGE_ACK": func() Event { return new(MessageAckEvent) },
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue