Builds file message send parameters from a local file (name, size, and inferred file type suffix).
The file to upload and send
A result containing SendFileMessageParams with file set, or an error if validation fails
Builds GIF message send parameters by loading the image to read width and height.
The GIF file to upload and send
A result containing SendGIFMessageParams with file set, or an error if the GIF cannot be loaded
Builds HD voice message send parameters by decoding audio to obtain duration, sample rate, and channel count (expects 16 kHz decode context).
The audio file to upload and send
A result containing SendHDVoiceMessageParams with file set, or an error if decoding fails
Builds image message send parameters by drawing a scaled thumbnail (max 160px) and JPEG base64 payload within size limits.
The image file to upload and send
A result containing SendImageMessageParams with file set, or an error if the image cannot be loaded
Helpers that construct media SendFileMessageParams, SendImageMessageParams, SendGIFMessageParams, and SendHDVoiceMessageParams from browser {@link File} objects. On success, pass
result.datato BaseChannel.sendMediaMessage.