Cannot SendSendMedia
See original GitHub issueHai Please help me I can’t SendMedia
here’s the error
(node:11228) UnhandledPromiseRejectionWarning: TypeError: Cannot destructure property ‘name’ of ‘file’ as it is undefined.
at Object.<anonymous> (D:\NodeJS\Tele\node_modules\telegram\client\uploads.js:38:17)
at Generator.next (<anonymous>)
at D:\NodeJS\Tele\node_modules\telegram\client\uploads.js:8:71
at new Promise (<anonymous>)
at __awaiter (D:\NodeJS\Tele\node_modules\telegram\client\uploads.js:4:12)
at Object.uploadFile (D:\NodeJS\Tele\node_modules\telegram\client\uploads.js:35:12)
at TelegramClient.uploadFile (D:\NodeJS\Tele\node_modules\telegram\client\TelegramClient.js:193:30)
at run (D:\NodeJS\Tele\app.js:21:22)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use node --trace-warnings ...
to show where the warning was created)
(node:11228) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11228) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
if you want to use
uploadFile
you need to use theCustomFile
class. you can also just usesendFile
https://painor.gitbook.io/gramjs/getting-started/available-methods/uploading-files-1@painor CustomFile is undefined for me… how to define it? Thanks a lot