Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metaplanet_room_chat-0.0.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

metaplanet_room_chat-0.0.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

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

Hashes for metaplanet_room_chat-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f1e78276f9cfd29a975f5edf2b276b07cecc7ccb51b2f47a17f6bcdd24666838
MD5 febeb7f44139515f17777e36c210108e
BLAKE2b-256 2bde977df5c6a118542bdf9cb1d93822d4392387d192b10f79a40d7e1771e8f5

See more details on using hashes here.

File details

Details for the file metaplanet_room_chat-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for metaplanet_room_chat-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 611a76b91f33568d410a63f5368509437a412f140a9a9ead89e63b4991752cda
MD5 2e6027a3b42d2ed0be2510f0addff798
BLAKE2b-256 0af68c7fcff0d810fe93ebaf2ee6129cae9f5e3b4dd7f13b337b2c35c7650f5f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page