Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 1337f70

Browse files
authored
Merge pull request #26 from DirectiveAthena/VipTag
Feat: VIP tag is now caught
2 parents 6869695 + 32b41d4 commit 1337f70

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def readme_handler() -> str:
1818

1919
def version_handler() -> str:
2020
# ------------------------------------------------------------------------------------------------------------------
21-
version = 0,8,0 # <-- DEFINE THE VERSION IN A TUPLE FORMAT HERE
21+
version = 0,8,1 # <-- DEFINE THE VERSION IN A TUPLE FORMAT HERE
2222
# ------------------------------------------------------------------------------------------------------------------
2323
return ".".join(str(i) for i in version)
2424

src/AthenaTwitchBot/models/twitch_bot/message_tags.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,34 @@
2323
# the key has to be mapped to the corresponding attr name and any conversion that needs to be done
2424

2525
MESSAGE_TAG_MAPPING:dict[str:tuple[str,Callable]] = {
26-
"badge-info": ("badge_info", (_return_as_is := lambda value: value),),
27-
"badges": ("badges", _return_as_is,),
28-
"client-nonce": ("client_nonce", _return_as_is,),
29-
"color": ("color", lambda value: HEX(value) if value else HEX(),),
30-
"display-name": ("display_name", _return_as_is,),
31-
"emotes": ("emotes", _return_as_is,),
32-
"first-msg": ("first_msg", (_return_as_bool:=lambda value: bool(int(value))),),
33-
"flag": ("flag", _return_as_is,),
34-
"flags": ("flags", _return_as_is,),
35-
"id": ("message_id", _return_as_is,),
36-
"mod": ("mod", _return_as_bool,),
37-
"room-id": ("room_id", _return_as_is,),
38-
"subscriber": ("subscriber", _return_as_bool,),
39-
"tmi-sent-ts": ("tmi_sent_ts", (_return_as_int := lambda value: int(value)),),
40-
"turbo": ("turbo", _return_as_bool,),
41-
"user-id": ("user_id", _return_as_int,),
42-
"user-type": ("user_type", _return_as_is,),
43-
"reply-parent-display-name": ("reply_parent_display_name", _return_as_is,),
44-
"reply-parent-msg-body": ("reply_parent_msg_body", _return_as_is,),
45-
"reply-parent-msg-id": ("reply_parent_msg_id", _return_as_is,),
46-
"reply-parent-user-id": ("reply_parent_user_id", _return_as_int,),
47-
"reply-parent-user-login": ("reply_parent_user_login", _return_as_is,),
48-
"emote-only": ("emote_only", _return_as_bool,),
49-
"returning-chatter": ("returning_chatter", _return_as_bool,),
26+
"badge-info": ("badge_info", (_return_as_is := lambda value: value)),
27+
"badges": ("badges", _return_as_is),
28+
"client-nonce": ("client_nonce", _return_as_is),
29+
"color": ("color", lambda value: HEX(value) if value else HEX()),
30+
"display-name": ("display_name", _return_as_is),
31+
"emotes": ("emotes", _return_as_is),
32+
"first-msg": ("first_msg", (_return_as_bool:=lambda value: bool(int(value)))),
33+
"flag": ("flag", _return_as_is),
34+
"flags": ("flags", _return_as_is),
35+
"id": ("message_id", _return_as_is),
36+
"mod": ("mod", _return_as_bool),
37+
"room-id": ("room_id", _return_as_is),
38+
"subscriber": ("subscriber", _return_as_bool),
39+
"tmi-sent-ts": ("tmi_sent_ts", (_return_as_int := lambda value: int(value))),
40+
"turbo": ("turbo", _return_as_bool),
41+
"user-id": ("user_id", _return_as_int),
42+
"user-type": ("user_type", _return_as_is),
43+
"reply-parent-display-name": ("reply_parent_display_name", _return_as_is),
44+
"reply-parent-msg-body": ("reply_parent_msg_body", _return_as_is),
45+
"reply-parent-msg-id": ("reply_parent_msg_id", _return_as_is),
46+
"reply-parent-user-id": ("reply_parent_user_id", _return_as_int),
47+
"reply-parent-user-login": ("reply_parent_user_login", _return_as_is),
48+
"emote-only": ("emote_only", _return_as_bool),
49+
"returning-chatter": ("returning_chatter", _return_as_bool),
5050
"custom-reward-id": ("custom_reward_id", _return_as_is),
5151
"emote-sets": ("emote_sets", _return_as_is),
5252
"msg-id": ("msg_id", _return_as_is),
53+
"vip": ("vip", _return_as_bool)
5354
}
5455

5556
# ----------------------------------------------------------------------------------------------------------------------
@@ -84,6 +85,7 @@ class MessageTags:
8485
custom_reward_id:str = NOTHING
8586
emote_sets:str =NOTHING
8687
msg_id:str=NOTHING
88+
vip:bool=False
8789

8890
@classmethod
8991
def new_from_tags_str(cls, tags_str:str) -> MessageTags:

0 commit comments

Comments
 (0)