forked from SwissCore92/comfyui-telegram-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
63 lines (51 loc) · 1.85 KB
/
__init__.py
File metadata and controls
63 lines (51 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from colorama import Fore
from .nodes import telegram
from .nodes import utils
from .nodes import converters
NODE_CLASS_MAPPINGS = {
f"TelegramSuite_{k}": v for k, v in {
"TelegramBot": telegram.TelegramBot,
"APIMethod": telegram.APIMethod,
"SendMessage": telegram.SendMessage,
"SendImage": telegram.SendImage,
"SendVideo": telegram.SendVideo,
"SendAudio": telegram.SendAudio,
"SendChatAction": telegram.SendChatAction,
"EditMessageText": telegram.EditMessageText,
"EditMessageCaption": telegram.EditMessageCaption,
"EditMessageImage": telegram.EditMessageImage,
"EditMessageVideo": telegram.EditMessageVideo,
"EditMessageAudio": telegram.EditMessageAudio,
"ParseJSON": utils.ParseJSON,
**converters.type_mapping
}.items()
}
NODE_DISPLAY_NAME_MAPPINGS = {
f"TelegramSuite_{k}": f"{v} 🔽" for k, v in {
"TelegramBot": "Telegram Bot",
"APIMethod": "API Method",
"SendMessage": "Send Message",
"SendImage": "Send Image(s)",
"SendVideo": "Send Video",
"SendAudio": "Send Audio",
"SendChatAction": "Send Chat Action",
"EditMessageText": "Edit Message Text",
"EditMessageCaption": "Edit Message Caption",
"EditMessageImage": "Edit Message Image",
"EditMessageVideo": "Edit Message Video",
"EditMessageAudio": "Edit Message Audio",
"ParseJSON": "Parse JSON",
**converters.name_mapping
}.items()
}
CUSTOM_NODE_INPUT_TYPES = {
"TELEGRAM_BOT": telegram.TelegramBot,
"MESSAGES": list[dict],
"MESSAGE_IDS": list[int],
}
__all__ = (
"NODE_CLASS_MAPPINGS",
"NODE_DISPLAY_NAME_MAPPINGS",
"CUSTOM_NODE_INPUT_TYPES",
)
print(f"\n{Fore.LIGHTCYAN_EX}[Telegram Suite 🔽] {len(NODE_CLASS_MAPPINGS)} nodes loaded!{Fore.RESET}\n")