MCPcopy
hub / github.com/wechaty/wechaty / toUrlLink

Method toUrlLink

src/user/message.ts:1007–1025  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1005 }
1006
1007 public async toUrlLink (): Promise<UrlLink> {
1008 log.verbose('Message', 'toUrlLink()')
1009
1010 if (!this.payload) {
1011 throw new Error('no payload')
1012 }
1013
1014 if (this.type() !== Message.Type.Url) {
1015 throw new Error('message not a Url Link')
1016 }
1017
1018 const urlPayload = await this.wechaty.puppet.messageUrl(this.id)
1019
1020 if (!urlPayload) {
1021 throw new Error(`no url payload for message ${this.id}`)
1022 }
1023
1024 return new UrlLink(urlPayload)
1025 }
1026
1027 public async toMiniProgram (): Promise<MiniProgram> {
1028 log.verbose('Message', 'toMiniProgram()')

Callers

nothing calls this directly

Calls 1

typeMethod · 0.95

Tested by

no test coverage detected