There's a method in Telegram API called sendAnimation
. There are two obligatory paramteres: chat_id
and animation
. animation
's descriptio is this:
Type: InputFile or String
Description: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More info on Sending Files »
I have a local .gif
file that I want to send. So it looks like I need to use that multipart/form-data
method. I don't understand what that method is. I checked out the InputFile
type's description:
InputFile This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.
Again, they write about that multipart/form-data
thing, but don't write what exactly that is.
I thought maybe I could upload a file using sendDocument
method, but the uploaded document must be of type InputFile
as well.
How do I make the InputFile
object out of my local .gif
? I can convert it to Java's InputStream
, but that's about it.