MCPcopy
hub / github.com/LLOneBot/LuckyLilliaBot / fetchFile

Method fetchFile

src/satori/message.ts:72–82  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

70 }
71
72 private async fetchFile(url: string) {
73 const res = await uri2local(this.ctx, url)
74 if (!res.success) {
75 this.ctx.logger.error(res.errMsg)
76 throw Error(res.errMsg)
77 }
78 if (!res.isLocal) {
79 this.deleteAfterSentFiles.push(res.path)
80 }
81 return res.path
82 }
83
84 private async getPeerAndElementsFromMsgId(msgId: string): Promise<{ peer: NT.Peer, elements: NT.MessageElement[] } | undefined> {
85 this.peer ??= await getPeer(this.ctx, this.channelId)

Callers 1

visitMethod · 0.95

Calls 2

uri2localFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected