1
0
Fork 0
mirror of https://github.com/diamondburned/cchat-discord.git synced 2024-12-22 20:36:45 +00:00

Bumped ningen and Arikawa

This commit is contained in:
diamondburned 2020-07-14 18:55:46 -07:00
parent 0a59062726
commit 607091d2af
6 changed files with 13 additions and 7 deletions

View file

@ -204,7 +204,7 @@ func (ch *Channel) JoinServer(ctx context.Context, ct cchat.MessagesContainer) (
}
// Subscribe to typing events.
ch.session.Members.Subscribe(ch.guildID)
ch.session.MemberState.Subscribe(ch.guildID)
// Listen to new members before creating the backlog and requesting members.
addcancel(ch.session.AddHandler(func(c *gateway.GuildMembersChunkEvent) {

View file

@ -100,7 +100,7 @@ func (ch *Channel) completeMentions(word string) (entries []cchat.CompletionEntr
// If we couldn't find any members, then we can request Discord to
// search for them.
if len(m) == 0 {
ch.session.Members.SearchMember(ch.guildID, word)
ch.session.MemberState.SearchMember(ch.guildID, word)
return
}
@ -171,7 +171,7 @@ func (ch *Channel) completeEmojis(word string) (entries []cchat.CompletionEntry)
return
}
e, err := ch.session.Emoji.Get(ch.guildID)
e, err := ch.session.EmojiState.Get(ch.guildID)
if err != nil {
return
}

4
go.mod
View file

@ -3,9 +3,9 @@ module github.com/diamondburned/cchat-discord
go 1.14
require (
github.com/diamondburned/arikawa v0.10.2
github.com/diamondburned/arikawa v0.10.5
github.com/diamondburned/cchat v0.0.43
github.com/diamondburned/ningen v0.1.1-0.20200712031630-349ee2c3f01c
github.com/diamondburned/ningen v0.1.1-0.20200715015332-cb3c7378b3c8
github.com/dustin/go-humanize v1.0.0
github.com/go-test/deep v1.0.6
github.com/pkg/errors v0.9.1

4
go.sum
View file

@ -29,6 +29,8 @@ github.com/diamondburned/arikawa v0.9.6 h1:6TpfTKa2btoVQGxojNqv8g2YC0tIc/tX5w/OC
github.com/diamondburned/arikawa v0.9.6/go.mod h1:nIhVIatzTQhPUa7NB8w4koG1RF9gYbpAr8Fj8sKq660=
github.com/diamondburned/arikawa v0.10.2 h1:xTsFWlWwGzFr8HD7tyv2jMRyserOR4yV5dhq/PZMPAA=
github.com/diamondburned/arikawa v0.10.2/go.mod h1:nIhVIatzTQhPUa7NB8w4koG1RF9gYbpAr8Fj8sKq660=
github.com/diamondburned/arikawa v0.10.5 h1:o5lBopooA+8cXlKZdct5qF0xztuZZ35phvQrwGS5vYM=
github.com/diamondburned/arikawa v0.10.5/go.mod h1:nIhVIatzTQhPUa7NB8w4koG1RF9gYbpAr8Fj8sKq660=
github.com/diamondburned/cchat v0.0.34 h1:BGiVxMRA9dmW3rLilIldBvjVan7eTTpaWCCfX9IKBYU=
github.com/diamondburned/cchat v0.0.34/go.mod h1:+zXktogE45A0om4fT6B/z6Ii7FXNafjxsNspI0rlhbU=
github.com/diamondburned/cchat v0.0.35 h1:WiMGl8BQJgbP9E4xRxgLGlqUsHpTcJgDKDt8/6a7lBk=
@ -59,6 +61,8 @@ github.com/diamondburned/ningen v0.1.1-0.20200711215126-d4b8a17e818d h1:XgG/KRbA
github.com/diamondburned/ningen v0.1.1-0.20200711215126-d4b8a17e818d/go.mod h1:NVneOJDUDEIC3cnyeh2vpeAPVtBdC2Kcy+uwDy4o2qk=
github.com/diamondburned/ningen v0.1.1-0.20200712031630-349ee2c3f01c h1:CpYhIGiRzee7Jm0H4c0fLvRe/08QitDNo8KHYtrOmFE=
github.com/diamondburned/ningen v0.1.1-0.20200712031630-349ee2c3f01c/go.mod h1:NVneOJDUDEIC3cnyeh2vpeAPVtBdC2Kcy+uwDy4o2qk=
github.com/diamondburned/ningen v0.1.1-0.20200715015332-cb3c7378b3c8 h1:0IxrMc4bh/sp2e0dnagKgM72i9CfCoo1FygyglJcXao=
github.com/diamondburned/ningen v0.1.1-0.20200715015332-cb3c7378b3c8/go.mod h1:SKPY3387RHCbMrnefex9D+zlrA2yB+LCtaaQAgatAuc=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=

View file

@ -157,7 +157,7 @@ func NewMessageCreate(c *gateway.MessageCreateEvent, s *Session) Message {
c.Member, _ = s.Store.Member(c.GuildID, c.Author.ID)
}
if c.Member == nil {
s.Members.RequestMember(c.GuildID, c.Author.ID)
s.MemberState.RequestMember(c.GuildID, c.Author.ID)
return NewMessage(c.Message, s, NewUser(c.Author))
}
@ -176,7 +176,7 @@ func NewBacklogMessage(m discord.Message, s *Session, g discord.Guild) Message {
mem, err := s.Store.Member(m.GuildID, m.Author.ID)
if err != nil {
s.Members.RequestMember(m.GuildID, m.Author.ID)
s.MemberState.RequestMember(m.GuildID, m.Author.ID)
return NewMessage(m, s, NewUser(m.Author))
}

View file

@ -100,6 +100,8 @@ func NewSession(s *state.State) (*Session, error) {
return nil, errors.Wrap(err, "Failed to create a state wrapper")
}
var _ state.Store = s
if err := s.Open(); err != nil {
return nil, err
}