rainbowBot/handlers/Inspire.php

32 lines
749 B
PHP
Raw Permalink Normal View History

2023-02-07 01:27:52 +01:00
<?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"
);
}
}