Skip to content

[Bug]: fetch_chatters_color not handling user without colorΒ #504

@MrChuw

Description

@MrChuw

What actually happened?

fetch_chatters_color gives an error if the user does not have any color set.

unpack requires a buffer of 3 bytes in line:

rgb: tuple[int, int, int] = struct.unpack("BBB", bytes.fromhex(value))

because the received value is an empty string.

What did you expect to happen instead?

Maybe return all the color values as None. Or return None for respected user_id instead of ChatterColor

Minimum reproducible example:

tmi_user = await ctx.bot.fetch_user(login=name)
tmi_color = (await ctx.bot.fetch_chatters_color([tmi_user.id]))[0]
color = tmi_color.color

Steps to reproduce the problem

Replace name with "cool_name" it has no color set.

Additional logs:

No response

System and Environment information

3.0.1

Metadata

Metadata

Assignees

Labels

3.xTwitchIO 3.0Addressed in next releaseThis issue will be closed when the next release is createdConfirmed BugBug has been confirmed

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions