juzibot / xiaoju

17 stars 2 forks source link

receiving message types and send message types should be the same? #12

Open dcsan opened 5 years ago

dcsan commented 5 years ago

out:

enum MessageType {
    TEXT = 0,
    IMAGE = 1,
    URL_LINK = 2,
    FILE = 3,
}

in:

enum MsgType {
    Unknown = 0,
    Attachment = 1,
    Audio = 2,
    Contact = 3,
    ChatHistory = 4,
    Emoticon = 5,
    Image = 6,
    Text = 7,
    Location = 8,
    MiniProgram = 9,
    Money = 10,
    Recalled = 11,
    Url = 12,
    Video = 13,
}

confusing why text isn't the same in both...

dcsan commented 5 years ago

https://github.com/botorange/xiaoju/wiki/API-Doc

refers to these docs here ^

iguxiaobei commented 4 years ago

no, they are different. Actually,MessageType is types we can send. and MsgType is types we can receive.

dcsan commented 4 years ago

Actually,MessageType is types we can send. and MsgType is types we can receive.

I understood that, so I had marked it as in and out above. But it would still be better if there was a common structure I think?

Unless you are designing a 'meta' format that works across multiple bot platforms, but those can just be extra data added on top. (hence metadata)

iguxiaobei commented 4 years ago

OK. We will think about it.