1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-01 04:24:19 +00:00

state: Add NewWithIdentifier

This commit is contained in:
diamondburned 2021-11-16 17:38:50 -08:00
parent 17b9c73ce3
commit 82790f526d
No known key found for this signature in database
GPG key ID: D78C4471CE776659

View file

@ -123,6 +123,12 @@ func NewWithIntents(token string, intents ...gateway.Intents) *State {
return NewFromSession(s, defaultstore.New()) return NewFromSession(s, defaultstore.New())
} }
// NewWithIdentifier creates a new state with the given gateway identifier.
func NewWithIdentifier(token string, id gateway.Identifier) *State {
s := session.NewWithIdentifier(id)
return NewFromSession(s, defaultstore.New())
}
// NewWithStore creates a new state with the given store cabinet. // NewWithStore creates a new state with the given store cabinet.
func NewWithStore(token string, cabinet *store.Cabinet) *State { func NewWithStore(token string, cabinet *store.Cabinet) *State {
s := session.New(token) s := session.New(token)