1
0
mirror of https://github.com/r4sas/php-mpos-telegram-push synced 2025-02-01 09:24:16 +00:00

add config value, fix warning if user_id is not found

This commit is contained in:
R4SAS 2019-12-07 11:40:30 +00:00
parent 47f5d04493
commit 48f64d9a56
2 changed files with 4 additions and 2 deletions

View File

@ -317,6 +317,7 @@ $config['system']['load']['max'] = 10.0;
/** /**
* Telegram notificator configuration * 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']['api_key'] = '';
$config['push']['telegram']['bot_username'] = '';

View File

@ -42,7 +42,8 @@ $prepareResponse = function ($message) use ($chatID, $api, $bitcoin, $block, $se
// Get userID in MPOS by chatID // Get userID in MPOS by chatID
$stmt = $mysqli->prepare("SELECT account_id as user_id FROM user_settings WHERE value LIKE '%".$chatID."%' LIMIT 1"); $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()) 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; if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300;
$response = ''; $response = '';