Fixed minor errors

This commit is contained in:
Hauke Zühl 2020-03-07 16:37:03 +01:00
parent d99e62ed99
commit 5c3599565b

View File

@ -18,7 +18,7 @@
* tgBotOwner: <hier DEINE Telegram-ID eintragen>
*/
function worker(string $response)
function worker(string $response, array $config)
{
$tomorrow = (new DateTime('tomorrow'))->format('d.m.Y');
$trashArr = str_getcsv($response, "\n");
@ -99,10 +99,10 @@ if ($response !== false) {
file_put_contents($muellFile, $response);
// Go on with checking the result data
worker($response);
worker($response, $config);
} else {
if (file_exists($muellFile)) {
worker(file_get_contents($muellFile));
worker(file_get_contents($muellFile), $config);
} else {
shell_exec(sprintf("echo Müllbot konnte keine Daten empfangen | %s -u %d", $config['pathBot'], $config['tgBotOwner']));
}