gateway: enable modern ready capabilities

This commit is contained in:
ayn2op 2026-08-18 02:11:36 -04:00
parent c6305c0510
commit a0c2f10c35
3 changed files with 12 additions and 8 deletions

9
go.mod
View file

@ -4,12 +4,17 @@ go 1.26.0
// replace github.com/ayn2op/tview => ../tview
// replace (
// github.com/ayn2op/arikawa/v3 => ../arikawa
// github.com/ayn2op/ningen/v3 => ../ningen
// )
require (
github.com/BurntSushi/toml v1.6.0
github.com/alecthomas/chroma/v2 v2.27.0
github.com/andybalholm/brotli v1.2.2
github.com/ayn2op/arikawa/v3 v3.0.0-20260818031739-707854a38891
github.com/ayn2op/ningen/v3 v3.0.1-0.20260818031845-664caaed64fc
github.com/ayn2op/arikawa/v3 v3.0.0-20260818060521-45d84650adce
github.com/ayn2op/ningen/v3 v3.0.1-0.20260818060652-dd6af4f3af5e
github.com/ayn2op/tview v0.0.0-20260812042550-0532d50b709f
github.com/bogdanfinn/fhttp v0.6.8
github.com/bogdanfinn/tls-client v1.15.1

8
go.sum
View file

@ -10,10 +10,10 @@ github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs
github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/andybalholm/brotli v1.2.2 h1:HzTuoo2ErYQqf5qvcJInB8uvqSVxRttzkFexPWtnceM=
github.com/andybalholm/brotli v1.2.2/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
github.com/ayn2op/arikawa/v3 v3.0.0-20260818031739-707854a38891 h1:iixz+hkG3rKVa2DxHiga+ZySUes+2rgcSDsfumtK91w=
github.com/ayn2op/arikawa/v3 v3.0.0-20260818031739-707854a38891/go.mod h1:O0QAm4VBLKBF01sofDEsAHGfD8+Tk8iWNYWksojTt6A=
github.com/ayn2op/ningen/v3 v3.0.1-0.20260818031845-664caaed64fc h1:XE0OWYFMvqKi4cFq8Z2jQ/qglaW2pYeKoSNRMZexWrg=
github.com/ayn2op/ningen/v3 v3.0.1-0.20260818031845-664caaed64fc/go.mod h1:1b+xGSqqPlpfOetP1GxuTPy1KHhDbj2pc4CY+pIICAs=
github.com/ayn2op/arikawa/v3 v3.0.0-20260818060521-45d84650adce h1:nSJzGucENNIrJH2fT5Fzw9EINwbjh6nQ9u/MpyYy240=
github.com/ayn2op/arikawa/v3 v3.0.0-20260818060521-45d84650adce/go.mod h1:O0QAm4VBLKBF01sofDEsAHGfD8+Tk8iWNYWksojTt6A=
github.com/ayn2op/ningen/v3 v3.0.1-0.20260818060652-dd6af4f3af5e h1:Ulb1o3SluOJOp7iUztOX+ZUlMprCLMSe1dS4D5H+VkM=
github.com/ayn2op/ningen/v3 v3.0.1-0.20260818060652-dd6af4f3af5e/go.mod h1:pTZpPeql1+s/RPziaJKw1aXBtzjz3/CeshRuWkXyv3k=
github.com/ayn2op/tview v0.0.0-20260812042550-0532d50b709f h1:RidxK97+mKbM25L2iIdM6i6nfdZBSd1chNCu8e0PbxE=
github.com/ayn2op/tview v0.0.0-20260812042550-0532d50b709f/go.mod h1:l/sE5dmdvLVlv/2rvoJFcFVl6uq9w2Z62/SfGpJiquw=
github.com/bdandy/go-errors v1.2.2 h1:WdFv/oukjTJCLa79UfkGmwX7ZxONAihKu4V0mLIs11Q=

View file

@ -80,14 +80,13 @@ func NewModel(cfg *config.Config, token string) *Model {
id := gateway.NewIdentifier(gateway.IdentifyCommand{
Token: token,
Properties: http.IdentifyProperties(),
Capabilities: gateway.VersionedReadStates | gateway.VersionedUserGuildSetttings,
Capabilities: gateway.LazyUserNotes | gateway.VersionedReadStates | gateway.VersionedUserGuildSetttings | gateway.DedupeUserObjects | gateway.PrioritizedReadyPayload | gateway.MultipleGuildExperimentPopulations | gateway.NonChannelReadStates | gateway.AuthTokenRefresh,
})
session := session.NewWithGateway(clientgateway.New(id), handler.New())
session.Client = http.NewClient(token)
state := state.NewFromSession(session, defaultstore.New())
m.state = ningen.FromState(state)
m.state.DontWaitForReady = true
m.events = make(chan gateway.Event)
m.state.AddHandler(m.events)