swiftui-shapes
swiftui-shapes copied to clipboard
Feature Request: Wechaty Could Support Quote Message
A lot IMs has quote messages or something like that, e.g. QQ, wechat, wecom, whatsapp and meta messenger, even github! So it would be great for Wechaty to support that. My early thoughts about this is to add a quote field in message payload which contains the id of the quoted message. The quoted message could be an image or video so save id as reference is good.
// get quote from a message
quote (): MessageInterface | null {
if (!this.payload) {
throw new Error('no payload')
}
let quoteMessageId = this.payload.quoteId
if (!quoteMessageId) {
return null // no quote is acceptable
}
}
const quoteMessage = (this.wechaty.Message as typeof MessageImpl).load(quoteMessageId)
return quoteMessage
}
For sending a quote message, I'm not sure how to implement it. I'm considering two options:
- add some options to
say()
, likecontact.say(content: Sayable, options?: messageOptions)
- add a new method, like
message.quote(contactOrRoom: Contact | Room, quotedMessage: Message)
Please tell me if you like this feature, and how you want to implement it. Cheers!