juzibot / xiaoju

17 stars 2 forks source link

document errors #14

Open dcsan opened 5 years ago

dcsan commented 5 years ago

Your docs say to expect:

{
    “chatId”: “bcdw2j234ko1”,
    “token”: “abcd”,
    “messageType”: 1, // MessageType, check below
    “payload”: {
        “text”: “Hello World”
    }
}

but in fact it's just type and not messageType

{ data:
  { messageId: 'xxx',
    chatId: 'xxxxx',
    roomTopic: 'edm test',
    roomId: 'xxxx@chatroom',
    contactName: 'me',
    contactId: 'xxxx',
    payload: { text: 'test' },
    type: 7,
    timestamp: 1560801152000,
    token: 'xxxx' } }
iguxiaobei commented 4 years ago

no.

{
    “chatId”: “bcdw2j234ko1”,
    “token”: “abcd”,
    “messageType”: 1, // MessageType, check below
    “payload”: {
        “text”: “Hello World”
    }
}

is data format when you are sending messages. but

{
  data: {
    messageId: 'xxx',
    chatId: 'xxxxx',
    roomTopic: 'edm test',
    roomId: 'xxxx@chatroom',
    contactName: 'me',
    contactId: 'xxxx',
    payload: {
      text: 'test'
    },
    type: 7,
    timestamp: 1560801152000,
    token: 'xxxx'
  }
}

is data format when you are receiving messages.