rainbowBot/handlers/Inspire.php
Mattia Mascarello 88ce5972b4 Major revision 2
2023-02-07 01:27:52 +01:00

32 lines
749 B
PHP

<?php
use \TelegramBot\Api\Types\Message;
use \TelegramBot\Api\Client;
class Inspire extends Command
{
public static function exposedCommands(): array
{
return [];
}
public function __construct(Message $message, Client $bot)
{
parent::__construct($message, $bot);
}
public function execute(): void
{
$url = file_get_contents("https://inspirobot.me/api?generate=true");
$this->bot->sendChatAction($this->message->getChat()->getId(), "upload_photo");
$this->bot->sendPhoto(
$this->message->getChat()->getId(),
$url,
null,
$this->message->getMessageId(),
null,
null,
"HTML"
);
}
}