вот как я хотел
или что-то подобное https://t.me/RoobaiOfficaial/2032
Я новичок в программировании и не могу заставить бота работать, любая помощь будет оценена
код, как я могу загрузить изображение и установить идентификатор чата
<form method="post" enctype="multipart/form-data">
<input type="text" name="chat_id" value="" />
<input type="url" name="photo" value="" />
<input type="submit" name="send" action="<?php echo $website.'/sendPhoto'?>"/>
</form>
и я добавляю сообщение и создаю 1 встроенную кнопку, которая содержит URL
<?php
$msg= urlencode("test message");
$token="bot_token";
$chatId="chat_id";
$response=($_POST['photo']);
$response=$response.urldecode($msg);
$keyboard = [
'inline_keyboard' => [
[
['text' => 'Buy Now', 'url' => 'https://i.stack.imgur.com/vLHu9.png']
]
]
];
$encodedKeyboard = json_encode($keyboard);
$parameters =
array(
'chat_id' => $chatId,
'text' => $response,
'reply_markup' => $encodedKeyboard
);
send('sendMessage', $parameters); // function description Below
function send($method, $data)
{
$url = "https://api.telegram.org/".$token. "/" . $method;
if (!$curld = curl_init()) {
exit;
}
curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $data);
curl_setopt($curld, CURLOPT_URL, $url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($curld);
curl_close($curld);
return $output;
}
Я получаю этот тип ответа, но он мне нужен без ссылки Ответ