mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-08 16:20:02 +00:00
[core] Fix: Emote sets are not int but uuid
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
2b1502e64f
commit
688c665356
1 changed files with 3 additions and 11 deletions
|
@ -1,13 +1,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type (
|
||||
|
@ -15,7 +13,7 @@ type (
|
|||
Badges twitch.BadgeCollection
|
||||
Color string
|
||||
DisplayName string
|
||||
EmoteSets []int64
|
||||
EmoteSets []string
|
||||
}
|
||||
|
||||
twitchUserStateStore struct {
|
||||
|
@ -34,18 +32,12 @@ func parseTwitchUserState(m *irc.Message) (*twitchUserState, error) {
|
|||
var (
|
||||
color, _ = m.GetTag("color")
|
||||
displayName, _ = m.GetTag("display-name")
|
||||
emoteSets []int64
|
||||
emoteSets []string
|
||||
rawSets, _ = m.GetTag("emote-sets")
|
||||
)
|
||||
|
||||
if rawSets != "" {
|
||||
for _, sid := range strings.Split(rawSets, ",") {
|
||||
id, err := strconv.ParseInt(sid, 10, 64)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "parsing emote-set id")
|
||||
}
|
||||
emoteSets = append(emoteSets, id)
|
||||
}
|
||||
emoteSets = strings.Split(rawSets, ",")
|
||||
}
|
||||
|
||||
return &twitchUserState{
|
||||
|
|
Loading…
Reference in a new issue