kanimaru / twitcher

Full Twitch Library for Godot
MIT License
64 stars 9 forks source link

twitch_tags parse_tags fails occasionally #18

Closed bappitybup closed 3 months ago

bappitybup commented 5 months ago

The error I get is: Invalid access of index '1' on a base object of type: 'PackedStringArray'.

in this function:

func parse_tags(tag_string: String, output: Object) -> void:
        _raw = tag_string;
        if tag_string.left(1) == "@":
            tag_string = tag_string.substr(1);

        var tags = tag_string.split(";");
        for tag in tags:
            var tag_value = tag.split("=");
            var property_name = tag_value[0].replace("-", "_");
            if _has_property(output, property_name):
                output.set(property_name, tag_value[1]);
            else:
                output._unmapped[property_name] = tag_value[1];

on the final line, which is line 94 in twitch_tags.

Variables

_unmapped

property_name

tag_value

output

kanimaru commented 5 months ago

The intresting point would be the message that got sended. Cause the unmapped stuff are things that Twitch didn't documented but still is sending. When this happen again can you maybe log the message that Twitch has send. And when you need a quick fix check for the length of the tag_value on the else: part.

bappitybup commented 5 months ago

The intresting point would be the message that got sended. Cause the unmapped stuff are things that Twitch didn't documented but still is sending. When this happen again can you maybe log the message that Twitch has send. And when you need a quick fix check for the length of the tag_value on the else: part.

thanks for the quick fix, I'll try get that and send it here