fixed custom badge fetching
This commit is contained in:
+2
-2
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"server_port": 60053,
|
||||
"server_listen_ip": "127.0.0.1",
|
||||
"debug": true,
|
||||
"debug": false,
|
||||
"useragent": "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0",
|
||||
"tw_backend_enabled": true,
|
||||
"tw_nickname": "Suborg",
|
||||
"tw_channel": "#suborg",
|
||||
"tw_channel": "#foxyshadow",
|
||||
"yt_backend_enabled": false,
|
||||
"yt_api_poll_timeout": 1,
|
||||
"yt_channel": "@foxyshadow",
|
||||
|
||||
+3
-2
@@ -72,7 +72,7 @@ func tw_fetch_badge_cache(channelname string) map[string]string {
|
||||
broadcaster_id := ""
|
||||
var ustruct map[string]interface{}
|
||||
/* get broadcaster ID from the channel name */
|
||||
body := tw_api_req(fmt.Sprintf("/users?login=%s", channelname), "")
|
||||
body := tw_api_req("/users?login=" + channelname, "")
|
||||
if len(body) > 0 {
|
||||
err := json.Unmarshal(body, &ustruct)
|
||||
if err == nil {
|
||||
@@ -281,7 +281,8 @@ func twitch_run(config map[string]interface{}) {
|
||||
TW_OAUTH_TOKEN, _ = strings.CutPrefix(config["tw_token"].(string), "oauth:")
|
||||
|
||||
/* load the Twitch badge cache */
|
||||
TW_BADGE_CACHE = tw_fetch_badge_cache(config["tw_channel"].(string))
|
||||
chname, _ := strings.CutPrefix(config["tw_channel"].(string), "#")
|
||||
TW_BADGE_CACHE = tw_fetch_badge_cache(chname)
|
||||
|
||||
/* Connect to the Twitch IRC server */
|
||||
conn, err := net.Dial("tcp", "irc.chat.twitch.tv:6667")
|
||||
|
||||
Reference in New Issue
Block a user