diff --git a/include/config/global.inc.dist.php b/include/config/global.inc.dist.php index e6c7095..1ae617f 100644 --- a/include/config/global.inc.dist.php +++ b/include/config/global.inc.dist.php @@ -317,6 +317,7 @@ $config['system']['load']['max'] = 10.0; /** * Telegram notificator configuration - * To use push notifications via Telegram you need create bot and set here its API key + * To use push notifications via Telegram you need create bot and set here its API key and username (without '@') **/ $config['push']['telegram']['api_key'] = ''; +$config['push']['telegram']['bot_username'] = ''; diff --git a/include/pages/tghook.inc.php b/include/pages/tghook.inc.php index 0af1e49..f28f95e 100644 --- a/include/pages/tghook.inc.php +++ b/include/pages/tghook.inc.php @@ -42,7 +42,8 @@ $prepareResponse = function ($message) use ($chatID, $api, $bitcoin, $block, $se // Get userID in MPOS by chatID $stmt = $mysqli->prepare("SELECT account_id as user_id FROM user_settings WHERE value LIKE '%".$chatID."%' LIMIT 1"); if($stmt && $stmt->execute() && $result = $stmt->get_result()) - $user_id = $result->fetch_object()->user_id; + $row = $result->fetch_object(); + $user_id = (!empty($row->user_id)) ? $row->user_id : 0; if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300; $response = '';