1. Go to this page and download the library: Download violetsun/max library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
violetsun / max example snippets
MAX::sendMessage(
1234567890,
[
'text' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.'
// there will be more to come...
]
);
Max::builder()
->chatId(1234567890)
->text("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
->attachments(function (AttachmentsBuilder $builder) {
$builder->image(
token: "TOKEN_IMAGE"
);
$builder->image(store: public_path('image.png'));
$builder->video(
token: "TOKEN_VIDEO"
);
$builder->inlineKeyboard(
$builder->row(
$builder->button->link(
text: "Lorem Ipsum 1",
url: "https://max.ru",
),
$builder->button->callback(
text: "Lorem Ipsum 2",
payload: "lorem-ipsum-2",
)
),
$builder->button->callback(
text: "Lorem Ipsum 3",
payload: "lorem-ipsum-3",
)
);
})
->send();
Max::builder()
->chatId(1234567890)
->text("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
->attachments(function (AttachmentsBuilder $builder) {
$builder->image(
token: "TOKEN_IMAGE"
);
$builder->inlineKeyboard(
$builder->button->callback(
text: "Lorem Ipsum 1",
payload: "lorem-ipsum-1",
)
);
})
->queue();