SendMediaGroup Telegram PHP
我正在使用电报库
php电报bot sdk
和我想使用 sendmediagroup
这样的消息发送一些照片:
$reply = "*photos*";
$telegram->sendMediaGroup([
'chat_id' => $chat,
'media' => [
['type' => 'photo', 'media' => 'attach://photo1' ],
['type' => 'photo', 'media' => 'attach://photo2' ],
],
'photo1' => InputFile::create(file_get_contents("https://".$_SERVER['SERVER_NAME']."/newbot/screens/ctry/en1.jpg")),
'photo2' => InputFile::create(file_get_contents("https://".$_SERVER['SERVER_NAME']."/newbot/screens/ctry/en2.jpg")),
'caption'=> $reply,
'parse_mode' => 'markdown'
]);
我没有 json_encode 和 file_get_get_contents T也工作
I am using telegram library
php telegram bot sdk
And I want to send some photos in message using sendMediaGroup
Like this:
$reply = "*photos*";
$telegram->sendMediaGroup([
'chat_id' => $chat,
'media' => [
['type' => 'photo', 'media' => 'attach://photo1' ],
['type' => 'photo', 'media' => 'attach://photo2' ],
],
'photo1' => InputFile::create(file_get_contents("https://".$_SERVER['SERVER_NAME']."/newbot/screens/ctry/en1.jpg")),
'photo2' => InputFile::create(file_get_contents("https://".$_SERVER['SERVER_NAME']."/newbot/screens/ctry/en2.jpg")),
'caption'=> $reply,
'parse_mode' => 'markdown'
]);
I used without json_encode and file_get_contents, but it doesn't worked too
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你为什么使用那个库?这是普通的解决方案:
我还放置了一些有用的变量,并有机会放上标题(如果您不想要一个参数,请不要给出该参数)
Why do you use that library? Here's the normal solution:
I also put there some useful variable and the chance to put a caption (don't give that parameter if you don't want one)
尝试一下:
Try This: