metaplanet room chat client
Project description
Metaplanet房间聊天客户端
使用说明
from metaplanet_room_chat.client import doConnect
from metaplanet_room_chat.handlers import encodePacket, Cmds
def on_receive(packet, wsapp, config):
print(f"收到报文:{packet}")
data = {"roomId": 75800, "content": "我是python bot, 大家好"}
sendPack = encodePacket(Cmds["ROOM_MSG_SEND_C"], data=data)
wsapp.send(sendPack)
doConnect(
ws="ws://assets.tpulse.cn/metacat/api/websocket/chat-proxy",
token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI3NDcwMCIsImF1ZCI6IkNoYXQgUHJveHkiLCJuYmYiOjE2ODk2NDIwNDUsImlzcyI6Imh0dHBzOi8vdHBsYW5ldC5ydWl4aS1zaC5jb20vIiwiZXhwIjoxNjkyMjM0MDQ1LCJlbnYiOiJmYXQiLCJpYXQiOjE2ODk2NDIwNDUsImp0aSI6IjIzYmRjY2VlLTM1OTMtNGUxYS1iMjM5LTQ0MjY4OWNjMTlhZCJ9.MLjUHZdz7ANQ5jYlH-uFPJ3N3pkBWulQUPwlPxcl7iU",
roomId=75800,
uid=74700,
on_receive=on_receive
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaplanet_room_chat-0.0.3.tar.gz.
File metadata
- Download URL: metaplanet_room_chat-0.0.3.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1e78276f9cfd29a975f5edf2b276b07cecc7ccb51b2f47a17f6bcdd24666838
|
|
| MD5 |
febeb7f44139515f17777e36c210108e
|
|
| BLAKE2b-256 |
2bde977df5c6a118542bdf9cb1d93822d4392387d192b10f79a40d7e1771e8f5
|
File details
Details for the file metaplanet_room_chat-0.0.3-py3-none-any.whl.
File metadata
- Download URL: metaplanet_room_chat-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
611a76b91f33568d410a63f5368509437a412f140a9a9ead89e63b4991752cda
|
|
| MD5 |
2e6027a3b42d2ed0be2510f0addff798
|
|
| BLAKE2b-256 |
0af68c7fcff0d810fe93ebaf2ee6129cae9f5e3b4dd7f13b337b2c35c7650f5f
|