Send Media

Send Document/File

Sends a file to given chat, with caption or not, using base64. This is exactly the same as send image

Parameters

message

Message that you will send

receiverNumber

Receiver number (e.g, [code country][number] 6283838204803)

file

File name (use relative path if the file is in outsite laravel folder, e.g /home/ardhana/Downloads/wavel.zip )

isGroup

fill true if the receiverNumber is group (e,g [code country][number]-[random number] 6283838204803-0000@g.us)

function document(String $message, String|Int $receiverNumber, String $file, bool $isGroup = false)

Example

\Ardzz\Wavel\Wavel::media()->document(
    'Here is GTA V RIP Compressed only 5MB!', 6283838204803,
    '/home/ardhana/Downloads/GTA_V_RIP_UltraCompressed.zip'
);

Send Image

Sends a image to given chat, with caption or not, using base64

Parameters

Description

message

Message that you will send

receiverNumber

Receiver number (e.g, [code country][number] 6283838204803)

file

Image's file name (use relative path if the file is in outsite laravel folder, e.g /home/ardhana/Downloads/cute_dog.png )

isGroup

fill true if the receiverNumber is group (e,g [code country][number]-[random number] 6283838204803-0000@g.us)

function image(String $message, String|Int $receiverNumber, String $file, bool $isGroup = false)

Example

\Ardzz\Wavel\Wavel::media()->image(
    'Looks at my dog! How cute he is', 6283838204803,
    '/home/ardhana/Downloads/cute_dog.png'
);

Send Image as Sticker

This function takes an image (including animated GIF) and sends it as a sticker to the recipient. This is helpful for sending semi-ephemeral things like QR codes. The advantage is that it will not show up in the recipients gallery. This function automatically converts images to the required webp format.

Parameters

Description

receiverNumber

Receiver number (e.g, [code country][number] 6283838204803)

file

Image's file name (use relative path if the file is in outsite laravel folder, e.g /home/ardhana/Downloads/cute_cat.jpg )

isGroup

fill true if the receiverNumber is group (e,g [code country][number]-[random number] 6283838204803-0000@g.us)

function imageAsSticker(String|Int $receiverNumber, String $file, bool $isGroup = false)

Example

\Ardzz\Wavel\Wavel::media()->imageAsSticker(6283838204803, '/home/ardhana/Downloads/cute_dog.png');

Send .webp File as Sticker

You can use this to send a raw webp file as sticker.

Parameters

Description

receiverNumber

Receiver number (e.g, [code country][number] 6283838204803)

file

.webp's file name (use relative path if the file is in outsite laravel folder, e.g /home/ardhana/Download/sticker.webp )

isGroup

fill true if the receiverNumber is group (e,g [code country][number]-[random number] 6283838204803-0000@g.us)

function rawWebpAsSticker(String|Int $receiverNumber, String $file, bool $isGroup = false)

Example

\Ardzz\Wavel\Wavel::media()->rawWebpAsSticker(6283838204803, '/home/ardhana/Downloads/sample_sticker.webp');

Send a File by URL

Sends a file by Url

Parameters

Description

receiverNumber

Receiver number (e.g, [code country][number] 6283838204803)

url

URL's file

message

Message that you will send

isGroup

fill true if the receiverNumber is group (e,g [code country][number]-[random number] 6283838204803-0000@g.us)

function fileFromURL(String|Int $receiverNumber, String $url, String $message, bool $isGroup = false)

Example

\Ardzz\Wavel\Wavel::media()->fileFromURL(6283838204803, 'https://github.com/ardzz/wavel/archive/refs/heads/master.zip', 'Wavel now is realease!! check this out');

Decrypt Media

Decrypts a media message.

Parameters

Description

messageId

The id of a message. The format is [boolean]_[ChatId]_[random character string]

Example:

"false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"

function decryptMedia(string $messageId)

Example

\Ardzz\Wavel\Wavel::media()->decryptMedia('false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB');

Last updated

Was this helpful?