mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-07-23 05:11:44 +00:00
Compare commits
2 commits
826b90a5f3
...
9a820c3749
Author | SHA1 | Date | |
---|---|---|---|
|
9a820c3749 | ||
|
7a7a56d613 |
|
@ -5,7 +5,7 @@
|
|||
"CGO_ENABLED": "1", # for the race detector
|
||||
"COV": "/tmp/cov_results",
|
||||
"dismock": "github.com/mavolin/dismock/v2/pkg/dismock",
|
||||
"dismock_v": "5c8df6ab93b919264ab156416c5803fb44491661",
|
||||
"dismock_v": "dc1c2e57a55d86999fa054f06ccc3665cbf7a3bd",
|
||||
# used only in integration_test
|
||||
"tested": "./api,./gateway,./bot,./discord"
|
||||
},
|
||||
|
|
|
@ -110,7 +110,7 @@ func NewWithIntents(token string, intents ...gateway.Intents) (*State, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return NewFromSession(s, defaultstore.New())
|
||||
return NewFromSession(s, defaultstore.New()), nil
|
||||
}
|
||||
|
||||
func NewWithStore(token string, cabinet store.Cabinet) (*State, error) {
|
||||
|
@ -119,12 +119,11 @@ func NewWithStore(token string, cabinet store.Cabinet) (*State, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return NewFromSession(s, cabinet)
|
||||
return NewFromSession(s, cabinet), nil
|
||||
}
|
||||
|
||||
// NewFromSession never returns an error. This API is kept for backwards
|
||||
// compatibility.
|
||||
func NewFromSession(s *session.Session, cabinet store.Cabinet) (*State, error) {
|
||||
// NewFromSession creates a new State from the passed Session and Cabinet.
|
||||
func NewFromSession(s *session.Session, cabinet store.Cabinet) *State {
|
||||
state := &State{
|
||||
Session: s,
|
||||
Cabinet: cabinet,
|
||||
|
@ -137,7 +136,7 @@ func NewFromSession(s *session.Session, cabinet store.Cabinet) (*State, error) {
|
|||
unreadyGuilds: moreatomic.NewGuildIDSet(),
|
||||
}
|
||||
state.hookSession()
|
||||
return state, nil
|
||||
return state
|
||||
}
|
||||
|
||||
// WithContext returns a shallow copy of State with the context replaced in the
|
||||
|
|
Loading…
Reference in a new issue