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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/Luzifer/twitch-bot/twitch"
|
"github.com/Luzifer/twitch-bot/twitch"
|
||||||
"github.com/go-irc/irc"
|
"github.com/go-irc/irc"
|
||||||
"github.com/pkg/errors"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
@ -15,7 +13,7 @@ type (
|
||||||
Badges twitch.BadgeCollection
|
Badges twitch.BadgeCollection
|
||||||
Color string
|
Color string
|
||||||
DisplayName string
|
DisplayName string
|
||||||
EmoteSets []int64
|
EmoteSets []string
|
||||||
}
|
}
|
||||||
|
|
||||||
twitchUserStateStore struct {
|
twitchUserStateStore struct {
|
||||||
|
@ -34,18 +32,12 @@ func parseTwitchUserState(m *irc.Message) (*twitchUserState, error) {
|
||||||
var (
|
var (
|
||||||
color, _ = m.GetTag("color")
|
color, _ = m.GetTag("color")
|
||||||
displayName, _ = m.GetTag("display-name")
|
displayName, _ = m.GetTag("display-name")
|
||||||
emoteSets []int64
|
emoteSets []string
|
||||||
rawSets, _ = m.GetTag("emote-sets")
|
rawSets, _ = m.GetTag("emote-sets")
|
||||||
)
|
)
|
||||||
|
|
||||||
if rawSets != "" {
|
if rawSets != "" {
|
||||||
for _, sid := range strings.Split(rawSets, ",") {
|
emoteSets = 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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return &twitchUserState{
|
return &twitchUserState{
|
||||||
|
|
Loading…
Reference in a new issue