Sending Messages

LIMITATIONS

Currently, messages can be sent only from intents and interactions.

Simple Text Message

$this->reply('Your order confirmed.');

Sending Templates

$keyboard = Keyboard::make([
    ReplyButton::make('Yes.'),
    ReplyButton::make('No.'),
]);

$this->reply('Are you sure?')->template($keyboard);

Attachments

$attachment = Attachment::image('http://lorempixel.com/400/200/');

$this->sendAttachment($attachment);

Sending attachments can be delayed too:

$attachment = Attachment::image('http://lorempixel.com/400/200/');

$this->sendAttachment($attachment);

Delay Sending

WARNING

In order to use delayed message sending, setup queues.

Both reply and sendAttachment methods can be delayed:

$this->reply('Hello')->delay(5); // send message in 5 seconds

$this->sendAttachment($attachment)->delay(now()->addMinutes(15)); // send message in 15 minutes
Last Updated: 8/27/2018, 9:34:51 PM