forked from pothtonswer/discordmuffin
Add missing fields to Ready (#1227)
* feat(Ready): add shard and application fields Add missing Shard and Application fields to Ready event struct. * feat(Ready): make Shard pointer Make Shard field pointer to be consistent with the API.
This commit is contained in:
parent
0c2b0eccf4
commit
afab84009b
2 changed files with 12 additions and 10 deletions
14
events.go
14
events.go
|
@ -36,13 +36,13 @@ type Event struct {
|
||||||
|
|
||||||
// A Ready stores all data for the websocket READY event.
|
// A Ready stores all data for the websocket READY event.
|
||||||
type Ready struct {
|
type Ready struct {
|
||||||
Version int `json:"v"`
|
Version int `json:"v"`
|
||||||
SessionID string `json:"session_id"`
|
SessionID string `json:"session_id"`
|
||||||
User *User `json:"user"`
|
User *User `json:"user"`
|
||||||
Guilds []*Guild `json:"guilds"`
|
Shard *[2]int `json:"shard"`
|
||||||
PrivateChannels []*Channel `json:"private_channels"`
|
Application *Application `json:"application"`
|
||||||
|
Guilds []*Guild `json:"guilds"`
|
||||||
// TODO: Application and Shard
|
PrivateChannels []*Channel `json:"private_channels"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChannelCreate is the data for a ChannelCreate event.
|
// ChannelCreate is the data for a ChannelCreate event.
|
||||||
|
|
8
state.go
8
state.go
|
@ -909,9 +909,11 @@ func (s *State) onReady(se *Session, r *Ready) (err error) {
|
||||||
// if state is disabled, store the bare essentials.
|
// if state is disabled, store the bare essentials.
|
||||||
if !se.StateEnabled {
|
if !se.StateEnabled {
|
||||||
ready := Ready{
|
ready := Ready{
|
||||||
Version: r.Version,
|
Version: r.Version,
|
||||||
SessionID: r.SessionID,
|
SessionID: r.SessionID,
|
||||||
User: r.User,
|
User: r.User,
|
||||||
|
Shard: r.Shard,
|
||||||
|
Application: r.Application,
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Ready = ready
|
s.Ready = ready
|
||||||
|
|
Loading…
Reference in a new issue