Major revision 2
This commit is contained in:
31
handlers/Inspire.php
Normal file
31
handlers/Inspire.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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"
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user