Skip to content

ارسال نشدن فایل به بات #21

@karim23657

Description

@karim23657

مشکل کد زیر که از مستندات پی اچ پی گرفته ام چیست کد برای ارسال عکس به ربات است
اما وقتی در سروش روی عکس میزنم می گویید"خطا دانلود" لطفا کمک کنید

`<?php

require dirname(FILE) . '/../vendor/autoload.php';

$bot_token = 'token';

$bot = new Soroush\Client($bot_token);

try {

$to = 'id';


list($error, $file_id) = $bot->uploadFile('https://www.roxo.ir/wp-content/uploads/2019/05/HTML-web-worker-696x452.jpg ');

if($error) {
    echo 'File Upload Error, Error : ' . $error . PHP_EOL;
    exit;
}

list($error, $success) = $bot->sendImage($to, 'aksnnnn', $file_id, basename($file_id), filesize('24.03'), 696, 452);

if($success) {
    echo 'Message sent successfully' . PHP_EOL;
} else {
    echo 'Fail : ' . $error;
}

} catch (Exception $e) {
die($e->getMessage());
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions