Skip to content

Commit 738ce34

Browse files
committed
text is None if message is None
1 parent cb7f344 commit 738ce34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

twitchio/models/eventsub_.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ class ChannelBitsUse(_ResponderEvent):
879879
text: str | None
880880
The chat message in plain text. Is `None` if no chat message was used.
881881
fragments: list[ChatMessageFragment]
882-
The ordered list of chat message fragments. Is `None` if no chat message was used.
882+
The ordered list of chat message fragments. This is only populated for Bits uses that contain a message.
883883
power_up: PowerUp | None
884884
Data about Power-up. Is `None` if a Power-up is not used.
885885
"""
@@ -896,7 +896,7 @@ def __init__(self, payload: ChannelBitsUseEvent, *, http: HTTPClient) -> None:
896896
self.bits: int = int(payload["bits"])
897897
self.type: Literal["cheer", "power_up", "combo"] = payload["type"]
898898
message = payload.get("message") or {}
899-
self.text: str = message.get("text", "")
899+
self.text: str | None = message.get("text")
900900
power_up = payload.get("power_up")
901901
self.power_up: PowerUp | None = PowerUp(power_up) if power_up is not None else None
902902
fragments = message.get("fragments", [])

0 commit comments

Comments
 (0)