How to SendDocument on Conversation?
❓ Support Question
Required Information
| ? | ! |
|---|---|
| Operating system | Linuxmint |
| PHP Telegram Bot version | 0.61.0 |
| PHP version | php7 |
| MySQL version | one |
| Update Method | Webhook |
| Self-signed certificate | no |
| RAW update (if available) | {...} |
Summary
when i call Kernel V1 on bot i got log error, can help me ? i try if user Call command Kernel V1 my bot reply with text and document
switch (true) {
case $text == 'Kernel V1': {
$this->conversation->update();
$out_text = "This Kernel Version Zero\n";
$out_text .= "Build 2352682";
$data['chat_id'] = $chat_id;
$data['caption'] = $out_text;
$data['document'] = Request::encodeFile(__DIR__ .'/Upload/kernel/kernel.zip');
$result = Request::sendDocument($data);
break;
}
case $text == 'Kernel V2': {
$this->conversation->update();
$data['text'] = 'This Kernel Version One:';
$data['chat_id'] = $chat_id;
$result = Request::sendMessage($data);
break;
}
}
Log Error :
PHP Warning: fopen(/home/oxygente/public_html/BotTelegram/oxygen-kernel/src/Commands/Commands/Upload/kernel/kernel.zip): failed to open stream: No such file or directory
thanks,
full command https://pastebin.com/GpW29sUM
According to the error message the file can't be found. Is the path correct?
Also, no need to use conversations here, just go for a simple if statement.
@oxygenfox Make sure the path to your files are correct.
Closing off here as this is not a library issue.