imbot-sdk-python 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- imbot_sdk/__init__.py +57 -0
- imbot_sdk/client.py +1155 -0
- imbot_sdk/consts.py +36 -0
- imbot_sdk/data_accessor.py +35 -0
- imbot_sdk/listeners.py +67 -0
- imbot_sdk/messages/__init__.py +93 -0
- imbot_sdk/messages/base.py +54 -0
- imbot_sdk/messages/contents.py +463 -0
- imbot_sdk/models.py +99 -0
- imbot_sdk/pb/__init__.py +0 -0
- imbot_sdk/pb/appmessages_pb2.py +433 -0
- imbot_sdk/pb/chatroom_pb2.py +98 -0
- imbot_sdk/pb/connect_pb2.py +55 -0
- imbot_sdk/pb/rtcroom_pb2.py +82 -0
- imbot_sdk/py.typed +0 -0
- imbot_sdk_python-0.1.0.dist-info/METADATA +296 -0
- imbot_sdk_python-0.1.0.dist-info/RECORD +20 -0
- imbot_sdk_python-0.1.0.dist-info/WHEEL +5 -0
- imbot_sdk_python-0.1.0.dist-info/licenses/LICENSE +201 -0
- imbot_sdk_python-0.1.0.dist-info/top_level.txt +1 -0
imbot_sdk/__init__.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""imbot-sdk-python: JuggleIM Python Bot SDK.
|
|
2
|
+
|
|
3
|
+
A WebSocket long-connection IM SDK for bots / server-side message agents.
|
|
4
|
+
|
|
5
|
+
Quick start::
|
|
6
|
+
|
|
7
|
+
from imbot_sdk import ImBotClient, Conversation, messages
|
|
8
|
+
from imbot_sdk.pb import appmessages_pb2 as pb
|
|
9
|
+
|
|
10
|
+
client = ImBotClient("wss://127.0.0.1", "your-appkey")
|
|
11
|
+
code, ack = client.connect("your-token")
|
|
12
|
+
|
|
13
|
+
text = messages.TextMessage("hello")
|
|
14
|
+
up = client.build_up_msg(text, client_uid="bot-1")
|
|
15
|
+
client.send_message(Conversation(conversation_type=pb.Private,
|
|
16
|
+
conversation="target-user"), up)
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from . import messages
|
|
20
|
+
from .client import ImBotClient, RTC_JOIN_ALREADY_IN_ROOM
|
|
21
|
+
from .consts import ClientErrorCode, ConnectState
|
|
22
|
+
from .listeners import (
|
|
23
|
+
ConnectionStatusChangeListener,
|
|
24
|
+
ConversationChangeListener,
|
|
25
|
+
MessageListener,
|
|
26
|
+
)
|
|
27
|
+
from .models import (
|
|
28
|
+
Conversation,
|
|
29
|
+
ConversationInfo,
|
|
30
|
+
ConversationMentionInfo,
|
|
31
|
+
Message,
|
|
32
|
+
MessageMentionInfo,
|
|
33
|
+
MessageReaction,
|
|
34
|
+
MessageReactionItem,
|
|
35
|
+
UserInfo,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
__version__ = "0.1.0"
|
|
39
|
+
|
|
40
|
+
__all__ = [
|
|
41
|
+
"ImBotClient",
|
|
42
|
+
"ClientErrorCode",
|
|
43
|
+
"ConnectState",
|
|
44
|
+
"RTC_JOIN_ALREADY_IN_ROOM",
|
|
45
|
+
"ConnectionStatusChangeListener",
|
|
46
|
+
"MessageListener",
|
|
47
|
+
"ConversationChangeListener",
|
|
48
|
+
"Conversation",
|
|
49
|
+
"ConversationInfo",
|
|
50
|
+
"ConversationMentionInfo",
|
|
51
|
+
"Message",
|
|
52
|
+
"MessageMentionInfo",
|
|
53
|
+
"MessageReaction",
|
|
54
|
+
"MessageReactionItem",
|
|
55
|
+
"UserInfo",
|
|
56
|
+
"messages",
|
|
57
|
+
]
|