Skip to content

Commit 8745eec

Browse files
authored
Merge pull request #342 from jacklul/botan-monolog
Botan integration - quick improvements
2 parents 7d38e1e + 516cd7a commit 8745eec

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/Botan.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ public static function track($input, $command = '')
110110
}
111111
}
112112
}
113+
} elseif (isset($obj['edited_message'])) {
114+
$data = $obj['edited_message'];
115+
$event_name = 'Edited Message';
116+
} elseif (isset($obj['channel_post'])) {
117+
$data = $obj['channel_post'];
118+
$event_name = 'Channel Message';
119+
} elseif (isset($obj['edited_channel_post'])) {
120+
$data = $obj['edited_channel_post'];
121+
$event_name = 'Edited Channel Message';
113122
} elseif (isset($obj['inline_query'])) {
114123
$data = $obj['inline_query'];
115124
$event_name = 'Inline Query';
@@ -146,7 +155,7 @@ public static function track($input, $command = '')
146155
$responseData = json_decode($response, true);
147156

148157
if ($responseData['status'] !== 'accepted') {
149-
error_log('Botan.io API replied with error: ' . $response);
158+
TelegramLog::debug('Botan.io API replied with error: ' . $response);
150159
}
151160

152161
return $responseData;
@@ -195,9 +204,7 @@ public static function shortenUrl($url, $user_id)
195204
if (!filter_var($response, FILTER_VALIDATE_URL) === false) {
196205
BotanDB::insertShortUrl($user_id, $url, $response);
197206
} else {
198-
// @TODO: Add telegram log
199-
error_log('Botan.io API replied with error: ' . $response);
200-
207+
TelegramLog::debug('Botan.io API replied with error: ' . $response);
201208
return $url;
202209
}
203210

0 commit comments

Comments
 (0)