dariotarantini / vgram

Telegram Bot library written in V.
MIT License
144 stars 19 forks source link

Support for multipart/form-data #17

Open davidebeatrici opened 1 year ago

davidebeatrici commented 1 year ago

https://github.com/dariotarantini/vgram/blob/32429ae3e2eb62d67d53f4678e6f1e348eb44144/types.v#L805-L806

From https://core.telegram.org/bots/api#sending-files:

Sending files

There are three ways to send files (photos, stickers, audio, media, etc.):

  1. If the file is already stored somewhere on the Telegram servers, you don't need to reupload it: each file object has a file_id field, simply pass this file_id as a parameter instead of uploading. There are no limits for files sent this way.
  2. Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.
  3. Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.
davidebeatrici commented 1 year ago

For reference, here's how a Lua library does it: https://github.com/wrxck/telegram-bot-lua/blob/9fe54d9ea25621a7de8f40518cf3b63d3e3d08e9/src/core.lua#L40-L93

We could use net.http.FileData and eventually net.http.post_multipart_form().

dariotarantini commented 1 year ago

I would like to wait until dev branch works with V lang. After that, I will implement this

davidebeatrici commented 1 year ago

Sounds good, thanks!

MALIKSHAHID786 commented 5 months ago

Hello,

We have an exciting opportunity for you! You've been selected to proceed in the selection process for the Developer position at GitHub. Congratulations on your achievement!

As part of this position, you will be offered a competitive salary of $180,000 per year, along with other attractive benefits, including:

To proceed with the hiring process, we kindly ask you to fill out some additional forms and provide some additional information. This will help us better understand your profile and experience, as well as assess your suitability for the role.

Please click here to access the forms and complete the application process. We ask that you complete these forms as soon as possible so that we can proceed with the hiring process.

Important: You have 24 hours to complete the application process.

If you have any questions or need further information, please don't hesitate to contact us.

Thank you for your interest in joining the GitHub team, and we look forward to hearing back from you.

Best regards,
GitHub Recruitment Team hpduong, @gongxinheng, @ffckaburga, @vbelowzero, @folasm87, @arslanmit, @roman-hart, @Nodd77, @kaiyiz, @vvsvvt, @fnavarrov, @ue, @roessland, @codealphago, @tshwangq, @dbongo, @CaptainRock, @wyczzpp, @amitsingh-as, @Saruultugs