We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3b97af6 + 1823c9a commit 1fada92Copy full SHA for 1fada92
examples/Commands/ImageCommand.php
@@ -41,6 +41,14 @@ public function execute()
41
$data['chat_id'] = $chat_id;
42
$data['caption'] = $text;
43
44
- return Request::sendPhoto($data, $this->telegram->getUploadPath().'/'.'image.jpg');
+ //return Request::sendPhoto($data, $this->telegram->getUploadPath().'/'.'image.jpg');
45
+ return Request::sendPhoto($data, $this->ShowRandomImage($this->telegram->getUploadPath()));
46
}
47
+ //return random picture from the telegram->getUploadPath();
48
+
49
+ private function ShowRandomImage($dir) {
50
+ $image_list = scandir($dir);
51
+ return $dir . "/" . $image_list[mt_rand(2, count($image_list) - 1)];
52
+ }
53
54
0 commit comments