( client: any, chatId: any, filePath: string, photoSetUrl?: string )
| 297 | } |
| 298 | |
| 299 | async 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 | |
| 325 | async function sendImageAlbum( |
| 326 | client: any, |
no outgoing calls
no test coverage detected