Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit 20aaca3

Browse files
authored
Overwrite entire emoji list on GuildEmojiUpdate (bwmarrin#1261)
* Overwrite entire emoji list on GuildEmojiUpdate deleted emoji should be deleted from cache * Updating GuildEmojis inline
1 parent 410cf4f commit 20aaca3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

state.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,14 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) {
10231023
}
10241024
case *GuildEmojisUpdate:
10251025
if s.TrackEmojis {
1026-
err = s.EmojisAdd(t.GuildID, t.Emojis)
1026+
var guild *Guild
1027+
guild, err = s.Guild(t.GuildID)
1028+
if err != nil {
1029+
return err
1030+
}
1031+
s.Lock()
1032+
defer s.Unlock()
1033+
guild.Emojis = t.Emojis
10271034
}
10281035
case *ChannelCreate:
10291036
if s.TrackChannels {

0 commit comments

Comments
 (0)