Commit 202d8d75 authored by Jack'lul's avatar Jack'lul

another fix for botan

parent 4fd2d0a7
......@@ -86,19 +86,21 @@ class Botan
$obj = json_decode($input, true);
if (isset($obj['message'])) {
$data = $obj['message'];
if ((isset($obj['message']['entities']) && $obj['message']['entities'][0]['type'] == 'bot_command' && $obj['message']['entities'][0]['offset'] == 0) || (substr($obj['message']['text'], 0, 1) == '/' && $obj['message']['text'] != '/')) {
if (strtolower($command) == 'generic') {
$command = 'Generic';
} elseif (strtolower($command) == 'genericmessage') {
$command = 'Generic Message';
} else {
$command = '/' . strtolower($command);
$event_name = 'Message';
if (isset($obj['message']['entities']) && is_array($obj['message']['entities'])) {
foreach ($obj['message']['entities'] as $entity) {
if ($entity['type'] == 'bot_command' && $entity['offset'] == 0) {
if (strtolower($command) == 'generic') {
$command = 'Generic';
} else {
$command = '/' . strtolower($command);
}
$event_name = 'Command (' . $command . ')';
break;
}
}
$event_name = 'Command ('.$command.')';
} else {
$event_name = 'Message';
}
} elseif (isset($obj['inline_query'])) {
$data = $obj['inline_query'];
......@@ -115,6 +117,8 @@ class Botan
return false;
}
self::$command = '';
$uid = $data['from']['id'];
$request = str_replace(
['#TOKEN', '#UID', '#NAME'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment