mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-10-08 12:58:34 +00:00
Added OpenAppButton factory method
This commit is contained in:
+2
-2
@@ -251,10 +251,10 @@ class Api
|
||||
try {
|
||||
$this->processUpdatesBatch($handlers, $timeout, $marker);
|
||||
} catch (NetworkException $e) {
|
||||
error_log("Network error: " . $e->getMessage());
|
||||
error_log('Network error: ' . $e->getMessage());
|
||||
sleep(5);
|
||||
} catch (\Exception $e) {
|
||||
error_log("An error occurred: " . $e->getMessage());
|
||||
error_log('An error occurred: ' . $e->getMessage());
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Inline\AbstractInlin
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Inline\CallbackButton;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Inline\ChatButton;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Inline\LinkButton;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Inline\OpenAppButton;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Inline\RequestContactButton;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Inline\RequestGeoLocationButton;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Reply\AbstractReplyButton;
|
||||
@@ -224,7 +225,7 @@ class ModelFactory
|
||||
AttachmentType::InlineKeyboard => InlineKeyboardAttachment::fromArray($data),
|
||||
AttachmentType::ReplyKeyboard => ReplyKeyboardAttachment::fromArray($data),
|
||||
AttachmentType::Location => LocationAttachment::fromArray($data),
|
||||
default => throw new LogicException("Unknown or unsupported attachment type: " . ($data['type'] ?? 'none')),
|
||||
default => throw new LogicException('Unknown or unsupported attachment type: ' . ($data['type'] ?? 'none')),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -265,7 +266,8 @@ class ModelFactory
|
||||
InlineButtonType::RequestContact => RequestContactButton::fromArray($data),
|
||||
InlineButtonType::RequestGeoLocation => RequestGeoLocationButton::fromArray($data),
|
||||
InlineButtonType::Chat => ChatButton::fromArray($data),
|
||||
default => throw new LogicException("Unknown or unsupported inline button type: " . ($data['type'] ?? 'none')),
|
||||
InlineButtonType::OpenApp => OpenAppButton::fromArray($data),
|
||||
default => throw new LogicException('Unknown or unsupported inline button type: ' . ($data['type'] ?? 'none')),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@ final readonly class Image extends AbstractModel
|
||||
/**
|
||||
* @param string $url URL of image.
|
||||
*/
|
||||
public function __construct(
|
||||
public string $url,
|
||||
) {
|
||||
public function __construct(public string $url)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user