get('telegram_chat_id'), 'text' => get('telegram_text'), 'parse_mode' => 'Markdown', ) ); $httpie = Httpie::get($telegramUrl); if (get('telegram_proxy', '') !== '') { $httpie = $httpie->setopt(CURLOPT_PROXY, get('telegram_proxy')); } $httpie->send(); }) ->once() ->shallow() ->hidden(); desc('Notifying Telegram about deploy finish'); task('telegram:notify:success', function () { if (!get('telegram_token', false)) { return; } if (!get('telegram_chat_id', false)) { return; } $telegramUrl = get('telegram_url') . '?' . http_build_query ( Array ( 'chat_id' => get('telegram_chat_id'), 'text' => get('telegram_success_text'), 'parse_mode' => 'Markdown', ) ); $httpie = Httpie::get($telegramUrl); if (get('telegram_proxy', '') !== '') { $httpie = $httpie->setopt(CURLOPT_PROXY, get('telegram_proxy')); } $httpie->send(); }) ->once() ->shallow() ->hidden(); desc('Notifying Telegram about deploy failure'); task('telegram:notify:failure', function () { if (!get('telegram_token', false)) { return; } if (!get('telegram_chat_id', false)) { return; } $telegramUrl = get('telegram_url') . '?' . http_build_query ( Array ( 'chat_id' => get('telegram_chat_id'), 'text' => get('telegram_failure_text'), 'parse_mode' => 'Markdown', ) ); $httpie = Httpie::get($telegramUrl); if (get('telegram_proxy', '') !== '') { $httpie = $httpie->setopt(CURLOPT_PROXY, get('telegram_proxy')); } $httpie->send(); }) ->once() ->shallow() ->hidden();