Rotur
  • Getting Started
  • Your Connection
    • What is a websocket?
    • Connecting
      • Handshake
      • SetID
      • Link
    • Authentication
      • Get User Data
      • Login
    • Rotur Designations
    • Websocket Commands
      • Global Message (gmsg)
      • Private Message (pmsg)
      • Login to rotur (auth)
  • My Account
    • Rotur Account Objects
      • originOS specific keys
    • Requesting my ofsf storage
    • Rotur Badges
    • Transactions and Taxes
  • Assorted APIs
    • rMail
    • avatars.rotur.dev
      • .banners
    • rotur.dev/auth
    • Keys
  • languages
    • RWL
      • Basics
      • Structure
      • Attributes
        • Text
        • Frame
        • Section
      • Alignments and Anchors
    • RTR
      • Basics
      • Structure
      • Functions
        • Mathematical Functions
        • String Functions
        • Array Functions
        • Object Functions
        • Logical Functions
        • Utility Functions
      • Events
      • Examples
    • RDF
  • Claw
    • What is claw
    • Api Endpoints
      • /feed
      • /post
      • /follow
      • /unfollow
      • /followers
      • /following
      • /profile
      • /delete
      • /rate
      • /following_feed
      • /reply
      • /repost
      • /top_posts
      • /search_posts
      • /search_users
  • Web Standard
    • What is this
  • Addons / Extensions
    • Basic Structure
    • Events
      • onload
      • page_load
      • page_focus
    • API
      • Classes
        • Page
          • (static) .new()
          • .getTitle()
        • URL
          • (static) .new()
          • (static) .parse()
          • .format()
          • .getAsyncData()
          • .getFetchUrl()
          • .getTitle()
    • Commands
      • redirect
      • opentab
    • Variables
      • tab_info
      • page_width / height
      • scroll_x / y
Powered by GitBook
On this page
  • Private Messaging (pmsg)
  • Client Request
  • Server Response
Edit on GitHub
  1. Your Connection
  2. Websocket Commands

Private Message (pmsg)

Private Messaging (pmsg)

The pmsg command is used to send a private message to a specific user.

Client Request

To send a private message, the client should format the JSON message like this:

{
  "cmd": "pmsg",
  "id": "recipient_username",
  "val": "Hello"
}

Field Descriptions:

  • cmd: Must be "pmsg". This indicates a private message.

  • id: The username of the intended recipient.

  • val: A string containing the content of the private message.

Server Response

Once the server processes the private message, it sends a status confirmation back to the sender:

{
  "cmd": "statuscode",
  "code": "I:100 | OK",
  "code_id": 100
}

The server also forwards the private message to the recipient with the following format:

{
  "cmd": "pmsg",
  "val": "Hello",
  "origin": { "username": "sender_username" },
  "rooms": "room_name"
}

Notes:

  • The origin field shows the sender's username.

  • The rooms field indicates the context or room in which the private message was sent. This is important if the recipient shares multiple rooms with the sender.

  • The private message is delivered only if the recipient is connected and present in at least one room shared with the sender.

PreviousGlobal Message (gmsg)NextLogin to rotur (auth)

Last updated 3 months ago