mirror of
https://github.com/diamondburned/cchat-discord.git
synced 2024-12-23 04:46:43 +00:00
Fixed typing events
This commit is contained in:
parent
fef47e3574
commit
4ecbbbe114
30
channel.go
30
channel.go
|
@ -431,34 +431,8 @@ func (ch *Channel) TypingSubscribe(ti cchat.TypingIndicator) (func(), error) {
|
|||
if t.ChannelID != ch.id {
|
||||
return
|
||||
}
|
||||
|
||||
if ch.guildID.Valid() {
|
||||
g, err := ch.session.Store.Guild(t.GuildID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if t.Member == nil {
|
||||
t.Member, err = ch.session.Store.Member(t.GuildID, t.UserID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ti.AddTyper(NewTyper(NewGuildMember(*t.Member, *g), t))
|
||||
return
|
||||
}
|
||||
|
||||
c, err := ch.self()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, user := range c.DMRecipients {
|
||||
if user.ID == t.UserID {
|
||||
ti.AddTyper(NewTyper(NewUser(user), t))
|
||||
return
|
||||
}
|
||||
if t, err := NewTyper(ch.session.Store, t); err == nil {
|
||||
ti.AddTyper(t)
|
||||
}
|
||||
}), nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue