Handling media files and download it
Handle when the user sends some media file (e.g. video, photo, audio) and download it
Handle when the user sends some media file
Use @OnMedia
, @OnPhoto
, @OnVideo
, @OnAudio
decorators to handle when the user sends some media file. You can read more about this here
Download sent media
Use the .saveFile
method in the Answer class to do this and pass the path to it. You can use this method to download any sent media (e.g. audio, video, photo). Below, you can see how to download the photo
.saveFile
method takes the path in which you want to save file as argument
You can read more about Answer
class here
.saveFile method take arguments:
Path in which you want to save file
Required
File id you want to save
Optional. Current file id by default (downloads media file sent by the user)
Download sent media using SaveFile class
You can also use SaveFile class-method to download media sent by the user. We recommend using this class-method if possible
SaveFile class-method take arguments:
Path in which you want to save file
Required
File id you want to save
Optional. Current file id by default (downloads media file sent by the user)
About .next
syntax you can read here
Last updated