1+ # ----------------------------------------------------------------------------------------------------------------------
2+ # - Package Imports -
3+ # ----------------------------------------------------------------------------------------------------------------------
4+ # General Packages
5+ from __future__ import annotations
6+ from typing import Callable
7+
8+ # Custom Library
9+ from AthenaColor import HEX
10+
11+ # Custom Packages
12+
13+ # ----------------------------------------------------------------------------------------------------------------------
14+ # - Code -
15+ # ----------------------------------------------------------------------------------------------------------------------
16+ MESSAGE_TAG_MAPPING :dict [str :Callable ] = {
17+ "@badge-info" : "badge_info" ,
18+ "badges" : "badges" ,
19+ "client-nonce" : "client_nonce" ,
20+ "color" : "color" ,
21+ "display-name" : "display_name" ,
22+ "emotes" : "emotes" ,
23+ "first-msg" : "first_msg" ,
24+ "flags" : "flags" ,
25+ "id" : "message_id" ,
26+ "mod" : "mod" ,
27+ "room-id" : "room_id" ,
28+ "subscriber" : "subscriber" ,
29+ "tmi-sent-ts" : "tmi_sent_ts" ,
30+ "turbo" : "turbo" ,
31+ "user-id" : "user_id" ,
32+ "user-type" : "user_type" ,
33+ "reply-parent-display-name" : "reply_parent_display_name" ,
34+ "reply-parent-msg-body" : "reply_parent_msg_body" ,
35+ "reply-parent-msg-id" : "reply_parent_msg_id" ,
36+ "reply-parent-user-id" : "reply_parent_user_id" ,
37+ "reply-parent-user-login" : "reply_parent_user_login" ,
38+ "emote-only" : "emote_only" ,
39+ }
40+
41+ MESSAGE_TAG_CONVERSION_MAPPING :dict [str :Callable ] = {
42+ "@badge-info" : lambda value : value ,
43+ "badges" : lambda value : value ,
44+ "client-nonce" : lambda value : value ,
45+ "color" : lambda value : HEX (value ) if value else HEX (),
46+ "display-name" : lambda value : value ,
47+ "emotes" : lambda value : value ,
48+ "first-msg" : lambda value : bool (int (value )),
49+ "flags" : lambda value : value ,
50+ "id" : lambda value : value ,
51+ "mod" : lambda value : bool (int (value )),
52+ "room-id" : lambda value : value ,
53+ "subscriber" : lambda value : bool (int (value )),
54+ "tmi-sent-ts" : lambda value : int (value ),
55+ "turbo" : lambda value : bool (int (value )),
56+ "user-id" : lambda value : int (value ),
57+ "user-type" : lambda value : value ,
58+ "reply-parent-display-name" :lambda value : value ,
59+ "reply-parent-msg-body" : lambda value : value ,
60+ "reply-parent-msg-id" : lambda value : int (value ),
61+ "reply-parent-user-id" : lambda value : int (value ),
62+ "reply-parent-user-login" : lambda value : value ,
63+ "emote-only" : lambda value : bool (int (value )),
64+ }
0 commit comments