mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-05 19:57:02 +00:00
Gateway: Deprecated useless type definitions for embedded structs
This commit is contained in:
parent
5b37b2ab0d
commit
9d7f5cb953
|
@ -20,9 +20,15 @@ type (
|
|||
|
||||
// https://discordapp.com/developers/docs/topics/gateway#channels
|
||||
type (
|
||||
ChannelCreateEvent discord.Channel
|
||||
ChannelUpdateEvent discord.Channel
|
||||
ChannelDeleteEvent discord.Channel
|
||||
ChannelCreateEvent struct {
|
||||
discord.Channel
|
||||
}
|
||||
ChannelUpdateEvent struct {
|
||||
discord.Channel
|
||||
}
|
||||
ChannelDeleteEvent struct {
|
||||
discord.Channel
|
||||
}
|
||||
ChannelPinsUpdateEvent struct {
|
||||
GuildID discord.Snowflake `json:"guild_id,omitempty"`
|
||||
ChannelID discord.Snowflake `json:"channel_id,omitempty"`
|
||||
|
@ -54,7 +60,9 @@ type (
|
|||
Channels []discord.Channel `json:"channels,omitempty"`
|
||||
Presences []discord.Presence `json:"presences,omitempty"`
|
||||
}
|
||||
GuildUpdateEvent discord.Guild
|
||||
GuildUpdateEvent struct {
|
||||
discord.Guild
|
||||
}
|
||||
GuildDeleteEvent struct {
|
||||
ID discord.Snowflake `json:"id"`
|
||||
// Unavailable if false == removed
|
||||
|
|
|
@ -80,7 +80,7 @@ func (s *State) onEvent(iface interface{}) {
|
|||
}
|
||||
|
||||
case *gateway.GuildUpdateEvent:
|
||||
if err := s.Store.GuildSet((*discord.Guild)(ev)); err != nil {
|
||||
if err := s.Store.GuildSet(&ev.Guild); err != nil {
|
||||
s.stateErr(err, "failed to update guild in state")
|
||||
}
|
||||
|
||||
|
@ -151,17 +151,17 @@ func (s *State) onEvent(iface interface{}) {
|
|||
}
|
||||
|
||||
case *gateway.ChannelCreateEvent:
|
||||
if err := s.Store.ChannelSet((*discord.Channel)(ev)); err != nil {
|
||||
if err := s.Store.ChannelSet(&ev.Channel); err != nil {
|
||||
s.stateErr(err, "failed to create a channel in state")
|
||||
}
|
||||
|
||||
case *gateway.ChannelUpdateEvent:
|
||||
if err := s.Store.ChannelSet((*discord.Channel)(ev)); err != nil {
|
||||
if err := s.Store.ChannelSet(&ev.Channel); err != nil {
|
||||
s.stateErr(err, "failed to update a channel in state")
|
||||
}
|
||||
|
||||
case *gateway.ChannelDeleteEvent:
|
||||
if err := s.Store.ChannelRemove((*discord.Channel)(ev)); err != nil {
|
||||
if err := s.Store.ChannelRemove(&ev.Channel); err != nil {
|
||||
s.stateErr(err, "failed to remove a channel in state")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue