MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / sendSingleImage

Function sendSingleImage

cosplay/cosplay.ts:299–323  ·  view source on GitHub ↗
(
  client: any,
  chatId: any,
  filePath: string,
  photoSetUrl?: string
)

Source from the content-addressed store, hash-verified

297}
298
299async function sendSingleImage(
300 client: any,
301 chatId: any,
302 filePath: string,
303 photoSetUrl?: string
304): Promise<void> {
305 const toUpload = new CustomFile(
306 path.basename(filePath),
307 fs.statSync(filePath).size,
308 filePath
309 );
310
311 const uploaded = await client.uploadFile({
312 file: toUpload,
313 workers: 1,
314 });
315
316 await client.sendFile(chatId, {
317 file: new Api.InputMediaUploadedPhoto({
318 file: uploaded,
319 spoiler: true,
320 }),
321 caption: photoSetUrl ? `套图链接: ${photoSetUrl}` : "",
322 });
323}
324
325async function sendImageAlbum(
326 client: any,

Callers 2

sendImageAlbumFunction · 0.85
sendImagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected