How can I parse the emotes out of a Twitch IRC response into an list of dictionaries?
<p>I would like to parse an IRC message from Twitch to a list of dictionaries, accounting for emotes.</p>

<p>Here is a sample of what I can get from Twitch:</p>

<pre><code>"Testing. :) Confirmed!"

{"emotes": [(1, (9, 10))]}
</code></pre>

<p>It describes that there is the emote with ID 1 from characters 9 to 10 (with the string being zero-indexed).</p>

<p>I would like to have my data in the following format:</p>

<pre><code>[
    {
        "type": "text",
        "text": "Testing. "
    },
    {
        "type": "emote",
        "text": ":)",
        "id": 1
    },
    {
        "type": "text",
        "text": " Confirmed!"
    }
]
</code></pre>

<p>Is there a relatively clean way to accomplish this?</p>