@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | use CURLFile; |
| 13 | 13 | |
| 14 | 14 | class webhook extends receiver {
|
| 15 | - public static function init () {
|
|
| 15 | + public static function init() {
|
|
| 16 | 16 | if (settings::$multi) {
|
| 17 | 17 | multi::init(); |
| 18 | 18 | } |
@@ -49,23 +49,23 @@ discard block |
||
| 49 | 49 | protected static function setWebhook(string $url) {
|
| 50 | 50 | $res = telegram::setWebhook($url, settings::$certificate, max_connections:settings::$max_connection, allowed_updates : settings::$allowed_updates); |
| 51 | 51 | if ($res->ok) {
|
| 52 | - logger::write('Webhook was set successfully',loggerTypes::INFO);
|
|
| 52 | + logger::write('Webhook was set successfully', loggerTypes::INFO);
|
|
| 53 | 53 | } |
| 54 | 54 | else {
|
| 55 | - logger::write("There is some problem happened , telegram response : \n".json_encode($res),loggerTypes::ERROR);
|
|
| 56 | - BPT::exit(print_r($res,true)); |
|
| 55 | + logger::write("There is some problem happened , telegram response : \n".json_encode($res), loggerTypes::ERROR);
|
|
| 56 | + BPT::exit(print_r($res, true)); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | protected static function checkURL() {
|
| 61 | 61 | if (!(isset($_SERVER['SERVER_NAME']) && isset($_SERVER['REQUEST_URI']))) {
|
| 62 | - logger::write('For using webhook receiver , you should open this file in your webserver(by domain)',loggerTypes::ERROR);
|
|
| 62 | + logger::write('For using webhook receiver , you should open this file in your webserver(by domain)', loggerTypes::ERROR);
|
|
| 63 | 63 | throw new bptException('WEBHOOK_NEED_URL');
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | private static function setURL(): string {
|
| 68 | - return (isset(settings::$certificate) ? 'http://' : 'https://') . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME']; |
|
| 68 | + return (isset(settings::$certificate) ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | protected static function setCertificate() {
|
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | protected static function telegramVerify(string $ip = null) {
|
| 23 | 23 | if (settings::$telegram_verify) {
|
| 24 | 24 | if (!tools::isTelegram($ip ?? $_SERVER['REMOTE_ADDR'] ?? '')) {
|
| 25 | - logger::write('not authorized access denied. IP : '. $ip ?? $_SERVER['REMOTE_ADDR'] ?? 'unknown',loggerTypes::WARNING);
|
|
| 25 | + logger::write('not authorized access denied. IP : '.$ip ?? $_SERVER['REMOTE_ADDR'] ?? 'unknown', loggerTypes::WARNING);
|
|
| 26 | 26 | BPT::exit(); |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - protected static function processUpdate(string|stdClass $update = null) {
|
|
| 31 | + protected static function processUpdate(string | stdClass $update = null) {
|
|
| 32 | 32 | if (!is_object($update)) {
|
| 33 | 33 | $update = json_decode($update ?? file_get_contents("php://input"));
|
| 34 | 34 | if (!$update) {
|
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | self::processHandler(); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - protected static function setMessageExtra (update &$update) {
|
|
| 44 | + protected static function setMessageExtra(update & $update) {
|
|
| 45 | 45 | if ((isset($update->message) && isset($update->message->text)) || (isset($update->edited_message) && isset($update->edited_message->text))) {
|
| 46 | 46 | $type = isset($update->message) ? 'message' : 'edited_message'; |
| 47 | 47 | $text = &$update->$type->text; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | BPT::$handler->something_else(BPT::$update); |
| 90 | 90 | } |
| 91 | 91 | else {
|
| 92 | - logger::write('Update received but handlers does not set',loggerTypes::WARNING);
|
|
| 92 | + logger::write('Update received but handlers does not set', loggerTypes::WARNING);
|
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * @param string $username Your text to be check is username or not e.g. : 'BPT_CH' | '@BPT_CH' |
| 23 | 23 | * @return bool |
| 24 | 24 | */ |
| 25 | - public static function isUsername (string $username): bool {
|
|
| 25 | + public static function isUsername(string $username): bool {
|
|
| 26 | 26 | $length = strlen($username); |
| 27 | 27 | return strpos($username, '__') === false && $length >= 5 && $length <= 33 && preg_match('/^@?([a-zA-Z])(\w{4,31})$/', $username);
|
| 28 | 28 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @param string $range Your range ip for check , if you didn't specify the block , it will be 32 |
| 39 | 39 | * @return bool |
| 40 | 40 | */ |
| 41 | - public static function ipInRange (string $ip, string $range): bool {
|
|
| 41 | + public static function ipInRange(string $ip, string $range): bool {
|
|
| 42 | 42 | if (!str_contains($range, '/')) {
|
| 43 | 43 | $range .= '/32'; |
| 44 | 44 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param string $ip Your ip to be check is telegram or not e.g. '192.168.1.1' |
| 58 | 58 | * @return bool |
| 59 | 59 | */ |
| 60 | - public static function isTelegram (string $ip): bool {
|
|
| 60 | + public static function isTelegram(string $ip): bool {
|
|
| 61 | 61 | return self::ipInRange($ip, '149.154.160.0/20') || self::ipInRange($ip, '91.108.4.0/22'); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | * @param string $ip Your ip to be check is CloudFlare or not e.g. '192.168.1.1' |
| 72 | 72 | * @return bool |
| 73 | 73 | */ |
| 74 | - public static function isCloudFlare (string $ip): bool {
|
|
| 74 | + public static function isCloudFlare(string $ip): bool {
|
|
| 75 | 75 | $cf_ips = ['173.245.48.0/20', '103.21.244.0/22', '103.22.200.0/22', '103.31.4.0/22', '141.101.64.0/18', '108.162.192.0/18', '190.93.240.0/20', '188.114.96.0/20', '197.234.240.0/22', '198.41.128.0/17', '162.158.0.0/15', '104.16.0.0/12', '172.64.0.0/13', '131.0.72.0/22']; |
| 76 | 76 | foreach ($cf_ips as $cf_ip) {
|
| 77 | - if (self::ipInRange($ip,$cf_ip)) {
|
|
| 77 | + if (self::ipInRange($ip, $cf_ip)) {
|
|
| 78 | 78 | return true; |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -95,9 +95,9 @@ discard block |
||
| 95 | 95 | * @param bool $verify check token with telegram or not |
| 96 | 96 | * @return bool|array return array when verify is active and token is true array of telegram getMe result |
| 97 | 97 | */ |
| 98 | - public static function isToken (string $token, bool $verify = false): bool|array {
|
|
| 98 | + public static function isToken(string $token, bool $verify = false): bool | array {
|
|
| 99 | 99 | if (preg_match('/^(\d{8,10}):[\w\-]{35}$/', $token)) {
|
| 100 | - if ($verify){
|
|
| 100 | + if ($verify) {
|
|
| 101 | 101 | $res = telegram::me($token); |
| 102 | 102 | if ($res['ok']) {
|
| 103 | 103 | return $res['result']; |
@@ -130,14 +130,14 @@ discard block |
||
| 130 | 130 | * @param int|null $user_id e.g. => '442109602' |
| 131 | 131 | * @return bool |
| 132 | 132 | */ |
| 133 | - public static function isJoined (array|string|int $ids , int|null $user_id = null): bool {
|
|
| 133 | + public static function isJoined(array | string | int $ids, int | null $user_id = null): bool {
|
|
| 134 | 134 | if (!is_array($ids)) {
|
| 135 | 135 | $ids = [$ids]; |
| 136 | 136 | } |
| 137 | 137 | //$user_id = $user_id ?? $this->catchFields(['field' => 'user_id']); |
| 138 | 138 | |
| 139 | 139 | foreach ($ids as $id) {
|
| 140 | - $check = telegram::getChatMember($id,$user_id); |
|
| 140 | + $check = telegram::getChatMember($id, $user_id); |
|
| 141 | 141 | if (isset($check['result'])) {
|
| 142 | 142 | $check = $check['result']['status']; |
| 143 | 143 | return !($check === chatMemberStatus::LEFT || $check === chatMemberStatus::KICKED); |
@@ -165,10 +165,10 @@ discard block |
||
| 165 | 165 | * @param string $characters e.g. => 'abcdefg' |
| 166 | 166 | * @return string |
| 167 | 167 | */ |
| 168 | - public static function randomString (int $length = 16, string $characters = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'): string {
|
|
| 168 | + public static function randomString(int $length = 16, string $characters = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'): string {
|
|
| 169 | 169 | $rand_string = ''; |
| 170 | 170 | $char_len = strlen($characters) - 1; |
| 171 | - for ($i = 0; $i < $length; $i ++) {
|
|
| 171 | + for ($i = 0; $i < $length; $i++) {
|
|
| 172 | 172 | $rand_string .= $characters[rand(0, $char_len)]; |
| 173 | 173 | } |
| 174 | 174 | return $rand_string; |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | * @param string $mode Your selected mode e.g. => `parseMode::HTML` | `HTML` |
| 188 | 188 | * @return string|false return false when mode is incorrect |
| 189 | 189 | */ |
| 190 | - public static function modeEscape (string $text, string $mode = parseMode::HTML): string|false {
|
|
| 190 | + public static function modeEscape(string $text, string $mode = parseMode::HTML): string | false {
|
|
| 191 | 191 | return match ($mode) {
|
| 192 | - parseMode::HTML => str_replace(['&', '<', '>',], ["&", "<", ">",], $text), |
|
| 193 | - parseMode::MARKDOWN => str_replace(['\\', '_', '*', '`', '['], ['\\\\', '\_', '\*', '\`', '\[',], $text), |
|
| 192 | + parseMode::HTML => str_replace(['&', '<', '>', ], ["&", "<", ">", ], $text), |
|
| 193 | + parseMode::MARKDOWN => str_replace(['\\', '_', '*', '`', '['], ['\\\\', '\_', '\*', '\`', '\[', ], $text), |
|
| 194 | 194 | parseMode::MARKDOWNV2 => str_replace( |
| 195 | 195 | ['_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!', '\\'],
|
| 196 | 196 | ['\_', '\*', '\[', '\]', '\(', '\)', '\~', '\`', '\>', '\#', '\+', '\-', '\=', '\|', '\{', '\}', '\.', '\!', '\\\\'],
|
@@ -216,10 +216,10 @@ discard block |
||
| 216 | 216 | * @param int $precision e.g. => 2 |
| 217 | 217 | * @return string |
| 218 | 218 | */ |
| 219 | - public static function byteFormat (int $byte, int $precision = 2): string {
|
|
| 219 | + public static function byteFormat(int $byte, int $precision = 2): string {
|
|
| 220 | 220 | $rate_counter = 0; |
| 221 | 221 | |
| 222 | - while ($byte > 1024){
|
|
| 222 | + while ($byte > 1024) {
|
|
| 223 | 223 | $byte /= 1024; |
| 224 | 224 | $rate_counter++; |
| 225 | 225 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $byte = round($byte, $precision); |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - return $byte . ' ' . ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'][$rate_counter]; |
|
| 231 | + return $byte.' '.['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'][$rate_counter]; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @param bool $format if you set this true , you will receive symbolic string like 2.76MB |
| 249 | 249 | * @return string|int|false string for formatted data , int for normal data , false when size can not be found(file not found or ...) |
| 250 | 250 | */ |
| 251 | - public static function size (string $path, bool $format = true): string|int|false {
|
|
| 251 | + public static function size(string $path, bool $format = true): string | int | false {
|
|
| 252 | 252 | if (filter_var($path, FILTER_VALIDATE_URL)) {
|
| 253 | 253 | $ch = curl_init($path); |
| 254 | 254 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | * @param array $array e.g. => ['path'=>'xfolder/yfolder','sub'=>true] |
| 284 | 284 | * @return bool |
| 285 | 285 | */ |
| 286 | - public static function delete (string $path, bool $sub = true): bool {
|
|
| 286 | + public static function delete(string $path, bool $sub = true): bool {
|
|
| 287 | 287 | if (is_dir($path)) {
|
| 288 | 288 | if (count(scandir($path)) > 2) {
|
| 289 | 289 | if ($sub) {
|
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | rmdir($path); |
| 296 | 296 | } |
| 297 | 297 | else {
|
| 298 | - logger::write("BPT delete function used\ndelete function cannot delete folder because its have subFiles and sub parameter haven't true value",loggerTypes::WARNING);
|
|
| 298 | + logger::write("BPT delete function used\ndelete function cannot delete folder because its have subFiles and sub parameter haven't true value", loggerTypes::WARNING);
|
|
| 299 | 299 | return false; |
| 300 | 300 | } |
| 301 | 301 | } |
@@ -318,9 +318,9 @@ discard block |
||
| 318 | 318 | * @return array |
| 319 | 319 | * @throws Exception |
| 320 | 320 | */ |
| 321 | - public static function time2string (int $datetime): array {
|
|
| 321 | + public static function time2string(int $datetime): array {
|
|
| 322 | 322 | $now = new DateTime; |
| 323 | - $input = new DateTime('@' . $datetime);
|
|
| 323 | + $input = new DateTime('@'.$datetime);
|
|
| 324 | 324 | $status = $now < $input ? 'later' : 'ago'; |
| 325 | 325 | $diff = $now->diff($input); |
| 326 | 326 | $diff->w = floor($diff->d / 7); |
@@ -12,32 +12,32 @@ discard block |
||
| 12 | 12 | class answer {
|
| 13 | 13 | private static bool $is_answered = false; |
| 14 | 14 | |
| 15 | - public static function init(string $method,array $data) {
|
|
| 15 | + public static function init(string $method, array $data) {
|
|
| 16 | 16 | self::checkAnswered(); |
| 17 | 17 | self::checkWebhook(); |
| 18 | 18 | self::deleteAdditionalData($data); |
| 19 | 19 | self::$is_answered = true; |
| 20 | 20 | $data['method'] = $method; |
| 21 | 21 | $payload = json_encode($data); |
| 22 | - header('Content-Type: application/json;Content-Length: ' . strlen($payload));
|
|
| 22 | + header('Content-Type: application/json;Content-Length: '.strlen($payload));
|
|
| 23 | 23 | echo $payload; |
| 24 | 24 | return true; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | private static function checkAnswered() {
|
| 28 | 28 | if (self::$is_answered) {
|
| 29 | - logger::write('You can use answer mode only once for each webhook update , You already did it!',loggerTypes::ERROR);
|
|
| 29 | + logger::write('You can use answer mode only once for each webhook update , You already did it!', loggerTypes::ERROR);
|
|
| 30 | 30 | throw new bptException('ANSWER_MODE_USED');
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | private static function checkWebhook() {
|
| 35 | - if(settings::$receiver === receiver::GETUPDATES) {
|
|
| 36 | - logger::write('Answer mode only work when receiver is webhook',loggerTypes::ERROR);
|
|
| 35 | + if (settings::$receiver === receiver::GETUPDATES) {
|
|
| 36 | + logger::write('Answer mode only work when receiver is webhook', loggerTypes::ERROR);
|
|
| 37 | 37 | throw new bptException('ANSWER_MODE_GETUPDATES');
|
| 38 | 38 | } |
| 39 | - elseif(settings::$multi) {
|
|
| 40 | - logger::write('You can not use answer mode when multi setting is on',loggerTypes::ERROR);
|
|
| 39 | + elseif (settings::$multi) {
|
|
| 40 | + logger::write('You can not use answer mode when multi setting is on', loggerTypes::ERROR);
|
|
| 41 | 41 | throw new bptException('ANSWER_MODE_MULTI');
|
| 42 | 42 | } |
| 43 | 43 | } |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | if (isset($data['return_array'])) {
|
| 53 | 53 | unset($data['return_array']); |
| 54 | 54 | } |
| 55 | - foreach ($data as $key=>&$value){
|
|
| 56 | - if (!isset($value)){
|
|
| 55 | + foreach ($data as $key=>&$value) {
|
|
| 56 | + if (!isset($value)) {
|
|
| 57 | 57 | unset($data[$key]); |
| 58 | 58 | } |
| 59 | - elseif (is_array($value) || (is_object($value) && !is_a($value,'CURLFile'))){
|
|
| 59 | + elseif (is_array($value) || (is_object($value) && !is_a($value, 'CURLFile'))) {
|
|
| 60 | 60 | $value = json_encode($value); |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -10,17 +10,17 @@ discard block |
||
| 10 | 10 | class curl {
|
| 11 | 11 | private static CurlHandle $curl_handler; |
| 12 | 12 | |
| 13 | - public static function init(string $method,array $data) {
|
|
| 13 | + public static function init(string $method, array $data) {
|
|
| 14 | 14 | $info = self::getInfo($data); |
| 15 | 15 | $data = $info['data']; |
| 16 | 16 | $handler = $info['handler']; |
| 17 | - self::setTimeout($data,$handler,$method); |
|
| 17 | + self::setTimeout($data, $handler, $method); |
|
| 18 | 18 | self::setData($data); |
| 19 | 19 | $data['method'] = $method; |
| 20 | 20 | curl_setopt($handler, CURLOPT_POSTFIELDS, $data); |
| 21 | 21 | $result = curl_exec($handler); |
| 22 | 22 | if (curl_errno($handler)) {
|
| 23 | - logger::write(curl_error($handler),loggerTypes::WARNING); |
|
| 23 | + logger::write(curl_error($handler), loggerTypes::WARNING); |
|
| 24 | 24 | } |
| 25 | 25 | if ($info['token'] != settings::$token) {
|
| 26 | 26 | curl_close($handler); |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | curl_setopt($curl_handler, CURLOPT_RETURNTRANSFER, true); |
| 37 | 37 | curl_setopt($curl_handler, CURLOPT_SSL_VERIFYPEER, false); |
| 38 | 38 | } |
| 39 | - else{
|
|
| 39 | + else {
|
|
| 40 | 40 | $token = settings::$token; |
| 41 | - if (!isset(self::$curl_handler)){
|
|
| 41 | + if (!isset(self::$curl_handler)) {
|
|
| 42 | 42 | self::$curl_handler = curl_init(settings::$base_url."$token/"); |
| 43 | 43 | curl_setopt(self::$curl_handler, CURLOPT_RETURNTRANSFER, true); |
| 44 | 44 | curl_setopt(self::$curl_handler, CURLOPT_SSL_VERIFYPEER, false); |
@@ -54,22 +54,22 @@ discard block |
||
| 54 | 54 | ]; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - private static function setTimeout(array &$data , CurlHandle $curl_handler,string $method) {
|
|
| 57 | + private static function setTimeout(array &$data, CurlHandle $curl_handler, string $method) {
|
|
| 58 | 58 | if (isset($data['forgot'])) {
|
| 59 | 59 | curl_setopt($curl_handler, CURLOPT_TIMEOUT_MS, settings::$forgot_time); |
| 60 | 60 | unset($data['forgot']); |
| 61 | 61 | } |
| 62 | - elseif ($method === 'getUpdates'){
|
|
| 62 | + elseif ($method === 'getUpdates') {
|
|
| 63 | 63 | curl_setopt($curl_handler, CURLOPT_TIMEOUT_MS, 5000); |
| 64 | 64 | } |
| 65 | - else{
|
|
| 65 | + else {
|
|
| 66 | 66 | curl_setopt($curl_handler, CURLOPT_TIMEOUT_MS, 300); |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | private static function setData(array &$data) {
|
| 71 | - foreach ($data as &$value){
|
|
| 72 | - if (is_array($value) || (is_object($value) && !is_a($value,'CURLFile'))){
|
|
| 71 | + foreach ($data as &$value) {
|
|
| 72 | + if (is_array($value) || (is_object($value) && !is_a($value, 'CURLFile'))) {
|
|
| 73 | 73 | $value = json_encode($value); |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | namespace BPT\api; |
| 4 | 4 | |
| 5 | 5 | class telegram extends request {
|
| 6 | - public function __call (string $name, array $arguments) {
|
|
| 6 | + public function __call(string $name, array $arguments) {
|
|
| 7 | 7 | if (!isset($arguments[1]) && isset($arguments[0]) && is_array($arguments[0])) {
|
| 8 | 8 | return request::$name(...$arguments[0]); |
| 9 | 9 | } |
@@ -449,94 +449,94 @@ discard block |
||
| 449 | 449 | ]; |
| 450 | 450 | |
| 451 | 451 | private const METHODS_KEYS = [ |
| 452 | - 'getUpdates' => ['offset','limit','timeout','allowed_updates','token','return_array','forgot','answer'], |
|
| 453 | - 'setWebhook' => ['url','certificate','ip_address','max_connections','allowed_updates','drop_pending_updates','secret_token','token','return_array','forgot','answer'], |
|
| 454 | - 'deleteWebhook' => ['drop_pending_updates','token','return_array','forgot','answer'], |
|
| 455 | - 'getWebhookInfo' => ['token','return_array','forgot','answer'], |
|
| 456 | - 'getMe' => ['token','return_array','forgot','answer'], |
|
| 457 | - 'logOut' => ['token','return_array','forgot','answer'], |
|
| 458 | - 'close' => ['token','return_array','forgot','answer'], |
|
| 459 | - 'sendMessage' => ['text','chat_id','parse_mode','entities','disable_web_page_preview','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 460 | - 'forwardMessage' => ['chat_id','from_chat_id','disable_notification','protect_content','message_id','token','return_array','forgot','answer'], |
|
| 461 | - 'copyMessage' => ['chat_id','from_chat_id','message_id','caption','parse_mode','caption_entities','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 462 | - 'sendPhoto' => ['photo','chat_id','caption','parse_mode','caption_entities','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 463 | - 'sendAudio' => ['audio','chat_id','caption','parse_mode','caption_entities','duration','performer','title','thumb','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 464 | - 'sendDocument' => ['document','chat_id','thumb','caption','parse_mode','caption_entities','disable_content_type_detection','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 465 | - 'sendVideo' => ['video','chat_id','duration','width','height','thumb','caption','parse_mode','caption_entities','supports_streaming','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 466 | - 'sendAnimation' => ['animation','chat_id','duration','width','height','thumb','caption','parse_mode','caption_entities','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 467 | - 'sendVoice' => ['voice','chat_id','caption','parse_mode','caption_entities','duration','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 468 | - 'sendVideoNote' => ['video_note','chat_id','duration','length','thumb','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 469 | - 'sendMediaGroup' => ['media','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','token','return_array','forgot','answer'], |
|
| 470 | - 'sendLocation' => ['latitude','longitude','chat_id','horizontal_accuracy','live_period','heading','proximity_alert_radius','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 471 | - 'editMessageLiveLocation' => ['latitude','longitude','chat_id','message_id','inline_message_id','horizontal_accuracy','heading','proximity_alert_radius','reply_markup','token','return_array','forgot','answer'], |
|
| 472 | - 'stopMessageLiveLocation' => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
|
| 473 | - 'sendVenue' => ['chat_id','latitude','longitude','title','address','foursquare_id','foursquare_type','google_place_id','google_place_type','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 474 | - 'sendContact' => ['phone_number','first_name','chat_id','last_name','vcard','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 475 | - 'sendPoll' => ['question','options','chat_id','is_anonymous','type','allows_multiple_answers','correct_option_id','explanation','explanation_parse_mode','explanation_entities','open_period','close_date','is_closed','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 476 | - 'sendDice' => ['chat_id','emoji','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 477 | - 'sendChatAction' => ['chat_id','action','token','return_array','forgot','answer'], |
|
| 478 | - 'getUserProfilePhotos' => ['user_id','offset','limit','token','return_array','forgot','answer'], |
|
| 479 | - 'getFile' => ['file_id','token','return_array','forgot','answer'], |
|
| 480 | - 'banChatMember' => ['chat_id','user_id','until_date','revoke_messages','token','return_array','forgot','answer'], |
|
| 481 | - 'unbanChatMember' => ['chat_id','user_id','only_if_banned','token','return_array','forgot','answer'], |
|
| 482 | - 'restrictChatMember' => ['permissions','chat_id','user_id','until_date','token','return_array','forgot','answer'], |
|
| 483 | - 'promoteChatMember' => ['chat_id','user_id','is_anonymous','can_manage_chat','can_post_messages','can_edit_messages','can_delete_messages','can_manage_video_chats','can_restrict_members','can_promote_members','can_change_info','can_invite_users','can_pin_messages','token','return_array','forgot','answer'], |
|
| 484 | - 'setChatAdministratorCustomTitle' => ['custom_title','chat_id','user_id','token','return_array','forgot','answer'], |
|
| 485 | - 'banChatSenderChat' => ['sender_chat_id','chat_id','token','return_array','forgot','answer'], |
|
| 486 | - 'unbanChatSenderChat' => ['sender_chat_id','chat_id','token','return_array','forgot','answer'], |
|
| 487 | - 'setChatPermissions' => ['permissions','chat_id','token','return_array','forgot','answer'], |
|
| 488 | - 'exportChatInviteLink' => ['chat_id','token','return_array','forgot','answer'], |
|
| 489 | - 'createChatInviteLink' => ['chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'], |
|
| 490 | - 'editChatInviteLink' => ['invite_link','chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'], |
|
| 491 | - 'revokeChatInviteLink' => ['invite_link','chat_id','token','return_array','forgot','answer'], |
|
| 492 | - 'approveChatJoinRequest' => ['chat_id','user_id','token','return_array','forgot','answer'], |
|
| 493 | - 'declineChatJoinRequest' => ['chat_id','user_id','token','return_array','forgot','answer'], |
|
| 494 | - 'setChatPhoto' => ['photo','chat_id','token','return_array','forgot','answer'], |
|
| 495 | - 'deleteChatPhoto' => ['chat_id','token','return_array','forgot','answer'], |
|
| 496 | - 'setChatTitle' => ['title','chat_id','token','return_array','forgot','answer'], |
|
| 497 | - 'setChatDescription' => ['chat_id','description','token','return_array','forgot','answer'], |
|
| 498 | - 'pinChatMessage' => ['message_id','chat_id','disable_notification','token','return_array','forgot','answer'], |
|
| 499 | - 'unpinChatMessage' => ['chat_id','message_id','token','return_array','forgot','answer'], |
|
| 500 | - 'unpinAllChatMessages' => ['chat_id','token','return_array','forgot','answer'], |
|
| 501 | - 'leaveChat' => ['chat_id','token','return_array','forgot','answer'], |
|
| 502 | - 'getChat' => ['chat_id','token','return_array','forgot','answer'], |
|
| 503 | - 'getChatAdministrators' => ['chat_id','token','return_array','forgot','answer'], |
|
| 504 | - 'getChatMemberCount' => ['chat_id','token','return_array','forgot','answer'], |
|
| 505 | - 'getChatMember' => ['chat_id','user_id','token','return_array','forgot','answer'], |
|
| 506 | - 'setChatStickerSet' => ['sticker_set_name','chat_id','token','return_array','forgot','answer'], |
|
| 507 | - 'deleteChatStickerSet' => ['chat_id','token','return_array','forgot','answer'], |
|
| 508 | - 'answerCallbackQuery' => ['callback_query_id','text','show_alert','url','cache_time','token','return_array','forgot','answer'], |
|
| 509 | - 'setMyCommands' => ['commands','scope','language_code','token','return_array','forgot','answer'], |
|
| 510 | - 'deleteMyCommands' => ['scope','language_code','token','return_array','forgot','answer'], |
|
| 511 | - 'getMyCommands' => ['scope','language_code','token','return_array','forgot','answer'], |
|
| 512 | - 'setChatMenuButton' => ['chat_id','menu_button','token','return_array','forgot','answer'], |
|
| 513 | - 'getChatMenuButton' => ['chat_id','token','return_array','forgot','answer'], |
|
| 514 | - 'setMyDefaultAdministratorRights' => ['rights','for_channels','token','return_array','forgot','answer'], |
|
| 515 | - 'getMyDefaultAdministratorRights' => ['for_channels','token','return_array','forgot','answer'], |
|
| 516 | - 'editMessageText' => ['text','chat_id','message_id','inline_message_id','parse_mode','entities','disable_web_page_preview','reply_markup','token','return_array','forgot','answer'], |
|
| 517 | - 'editMessageCaption' => ['chat_id','message_id','inline_message_id','caption','parse_mode','caption_entities','reply_markup','token','return_array','forgot','answer'], |
|
| 518 | - 'editMessageMedia' => ['media','chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
|
| 519 | - 'editMessageReplyMarkup' => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
|
| 520 | - 'stopPoll' => ['chat_id','message_id','reply_markup','token','return_array','forgot','answer'], |
|
| 521 | - 'deleteMessage' => ['chat_id','message_id','token','return_array','forgot','answer'], |
|
| 522 | - 'sendSticker' => ['sticker','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 523 | - 'getStickerSet' => ['name','token','return_array','forgot','answer'], |
|
| 524 | - 'uploadStickerFile' => ['png_sticker','user_id','token','return_array','forgot','answer'], |
|
| 525 | - 'createNewStickerSet' => ['name','title','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','contains_masks','mask_position','token','return_array','forgot','answer'], |
|
| 526 | - 'addStickerToSet' => ['name','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','mask_position','token','return_array','forgot','answer'], |
|
| 527 | - 'setStickerPositionInSet' => ['sticker','position','token','return_array','forgot','answer'], |
|
| 528 | - 'deleteStickerFromSet' => ['sticker','token','return_array','forgot','answer'], |
|
| 529 | - 'setStickerSetThumb' => ['name','user_id','thumb','token','return_array','forgot','answer'], |
|
| 530 | - 'answerInlineQuery' => ['results','inline_query_id','cache_time','is_personal','next_offset','switch_pm_text','switch_pm_parameter','token','return_array','forgot','answer'], |
|
| 531 | - 'answerWebAppQuery' => ['web_app_query_id','result','token','return_array','forgot','answer'], |
|
| 532 | - 'sendInvoice' => ['title','description','payload','provider_token','currency','prices','chat_id','max_tip_amount','suggested_tip_amounts','start_parameter','provider_data','photo_url','photo_size','photo_width','photo_height','need_name','need_phone_number','need_email','need_shipping_address','send_phone_number_to_provider','send_email_to_provider','is_flexible','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 533 | - 'createInvoiceLink' => ['title','description','payload','provider_token','currency','prices','max_tip_amount','suggested_tip_amounts','provider_data','photo_url','photo_size','photo_width','photo_height','need_name','need_phone_number','need_email','need_shipping_address','send_phone_number_to_provider','send_email_to_provider','is_flexible','token','return_array','forgot','answer'], |
|
| 534 | - 'answerShippingQuery' => ['ok','shipping_query_id','shipping_options','error_message','token','return_array','forgot','answer'], |
|
| 535 | - 'answerPreCheckoutQuery' => ['ok','pre_checkout_query_id','error_message','token','return_array','forgot','answer'], |
|
| 536 | - 'setPassportDataErrors' => ['errors','user_id','token','return_array','forgot','answer'], |
|
| 537 | - 'sendGame' => ['game_short_name','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
| 538 | - 'setGameScore' => ['score','user_id','force','disable_edit_message','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'], |
|
| 539 | - 'getGameHighScores' => ['user_id','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'], |
|
| 452 | + 'getUpdates' => ['offset', 'limit', 'timeout', 'allowed_updates', 'token', 'return_array', 'forgot', 'answer'], |
|
| 453 | + 'setWebhook' => ['url', 'certificate', 'ip_address', 'max_connections', 'allowed_updates', 'drop_pending_updates', 'secret_token', 'token', 'return_array', 'forgot', 'answer'], |
|
| 454 | + 'deleteWebhook' => ['drop_pending_updates', 'token', 'return_array', 'forgot', 'answer'], |
|
| 455 | + 'getWebhookInfo' => ['token', 'return_array', 'forgot', 'answer'], |
|
| 456 | + 'getMe' => ['token', 'return_array', 'forgot', 'answer'], |
|
| 457 | + 'logOut' => ['token', 'return_array', 'forgot', 'answer'], |
|
| 458 | + 'close' => ['token', 'return_array', 'forgot', 'answer'], |
|
| 459 | + 'sendMessage' => ['text', 'chat_id', 'parse_mode', 'entities', 'disable_web_page_preview', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 460 | + 'forwardMessage' => ['chat_id', 'from_chat_id', 'disable_notification', 'protect_content', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 461 | + 'copyMessage' => ['chat_id', 'from_chat_id', 'message_id', 'caption', 'parse_mode', 'caption_entities', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 462 | + 'sendPhoto' => ['photo', 'chat_id', 'caption', 'parse_mode', 'caption_entities', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 463 | + 'sendAudio' => ['audio', 'chat_id', 'caption', 'parse_mode', 'caption_entities', 'duration', 'performer', 'title', 'thumb', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 464 | + 'sendDocument' => ['document', 'chat_id', 'thumb', 'caption', 'parse_mode', 'caption_entities', 'disable_content_type_detection', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 465 | + 'sendVideo' => ['video', 'chat_id', 'duration', 'width', 'height', 'thumb', 'caption', 'parse_mode', 'caption_entities', 'supports_streaming', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 466 | + 'sendAnimation' => ['animation', 'chat_id', 'duration', 'width', 'height', 'thumb', 'caption', 'parse_mode', 'caption_entities', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 467 | + 'sendVoice' => ['voice', 'chat_id', 'caption', 'parse_mode', 'caption_entities', 'duration', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 468 | + 'sendVideoNote' => ['video_note', 'chat_id', 'duration', 'length', 'thumb', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 469 | + 'sendMediaGroup' => ['media', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'token', 'return_array', 'forgot', 'answer'], |
|
| 470 | + 'sendLocation' => ['latitude', 'longitude', 'chat_id', 'horizontal_accuracy', 'live_period', 'heading', 'proximity_alert_radius', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 471 | + 'editMessageLiveLocation' => ['latitude', 'longitude', 'chat_id', 'message_id', 'inline_message_id', 'horizontal_accuracy', 'heading', 'proximity_alert_radius', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 472 | + 'stopMessageLiveLocation' => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 473 | + 'sendVenue' => ['chat_id', 'latitude', 'longitude', 'title', 'address', 'foursquare_id', 'foursquare_type', 'google_place_id', 'google_place_type', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 474 | + 'sendContact' => ['phone_number', 'first_name', 'chat_id', 'last_name', 'vcard', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 475 | + 'sendPoll' => ['question', 'options', 'chat_id', 'is_anonymous', 'type', 'allows_multiple_answers', 'correct_option_id', 'explanation', 'explanation_parse_mode', 'explanation_entities', 'open_period', 'close_date', 'is_closed', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 476 | + 'sendDice' => ['chat_id', 'emoji', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 477 | + 'sendChatAction' => ['chat_id', 'action', 'token', 'return_array', 'forgot', 'answer'], |
|
| 478 | + 'getUserProfilePhotos' => ['user_id', 'offset', 'limit', 'token', 'return_array', 'forgot', 'answer'], |
|
| 479 | + 'getFile' => ['file_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 480 | + 'banChatMember' => ['chat_id', 'user_id', 'until_date', 'revoke_messages', 'token', 'return_array', 'forgot', 'answer'], |
|
| 481 | + 'unbanChatMember' => ['chat_id', 'user_id', 'only_if_banned', 'token', 'return_array', 'forgot', 'answer'], |
|
| 482 | + 'restrictChatMember' => ['permissions', 'chat_id', 'user_id', 'until_date', 'token', 'return_array', 'forgot', 'answer'], |
|
| 483 | + 'promoteChatMember' => ['chat_id', 'user_id', 'is_anonymous', 'can_manage_chat', 'can_post_messages', 'can_edit_messages', 'can_delete_messages', 'can_manage_video_chats', 'can_restrict_members', 'can_promote_members', 'can_change_info', 'can_invite_users', 'can_pin_messages', 'token', 'return_array', 'forgot', 'answer'], |
|
| 484 | + 'setChatAdministratorCustomTitle' => ['custom_title', 'chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 485 | + 'banChatSenderChat' => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 486 | + 'unbanChatSenderChat' => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 487 | + 'setChatPermissions' => ['permissions', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 488 | + 'exportChatInviteLink' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 489 | + 'createChatInviteLink' => ['chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'], |
|
| 490 | + 'editChatInviteLink' => ['invite_link', 'chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'], |
|
| 491 | + 'revokeChatInviteLink' => ['invite_link', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 492 | + 'approveChatJoinRequest' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 493 | + 'declineChatJoinRequest' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 494 | + 'setChatPhoto' => ['photo', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 495 | + 'deleteChatPhoto' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 496 | + 'setChatTitle' => ['title', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 497 | + 'setChatDescription' => ['chat_id', 'description', 'token', 'return_array', 'forgot', 'answer'], |
|
| 498 | + 'pinChatMessage' => ['message_id', 'chat_id', 'disable_notification', 'token', 'return_array', 'forgot', 'answer'], |
|
| 499 | + 'unpinChatMessage' => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 500 | + 'unpinAllChatMessages' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 501 | + 'leaveChat' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 502 | + 'getChat' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 503 | + 'getChatAdministrators' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 504 | + 'getChatMemberCount' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 505 | + 'getChatMember' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 506 | + 'setChatStickerSet' => ['sticker_set_name', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 507 | + 'deleteChatStickerSet' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 508 | + 'answerCallbackQuery' => ['callback_query_id', 'text', 'show_alert', 'url', 'cache_time', 'token', 'return_array', 'forgot', 'answer'], |
|
| 509 | + 'setMyCommands' => ['commands', 'scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
| 510 | + 'deleteMyCommands' => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
| 511 | + 'getMyCommands' => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
| 512 | + 'setChatMenuButton' => ['chat_id', 'menu_button', 'token', 'return_array', 'forgot', 'answer'], |
|
| 513 | + 'getChatMenuButton' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 514 | + 'setMyDefaultAdministratorRights' => ['rights', 'for_channels', 'token', 'return_array', 'forgot', 'answer'], |
|
| 515 | + 'getMyDefaultAdministratorRights' => ['for_channels', 'token', 'return_array', 'forgot', 'answer'], |
|
| 516 | + 'editMessageText' => ['text', 'chat_id', 'message_id', 'inline_message_id', 'parse_mode', 'entities', 'disable_web_page_preview', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 517 | + 'editMessageCaption' => ['chat_id', 'message_id', 'inline_message_id', 'caption', 'parse_mode', 'caption_entities', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 518 | + 'editMessageMedia' => ['media', 'chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 519 | + 'editMessageReplyMarkup' => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 520 | + 'stopPoll' => ['chat_id', 'message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 521 | + 'deleteMessage' => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 522 | + 'sendSticker' => ['sticker', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 523 | + 'getStickerSet' => ['name', 'token', 'return_array', 'forgot', 'answer'], |
|
| 524 | + 'uploadStickerFile' => ['png_sticker', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 525 | + 'createNewStickerSet' => ['name', 'title', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'contains_masks', 'mask_position', 'token', 'return_array', 'forgot', 'answer'], |
|
| 526 | + 'addStickerToSet' => ['name', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'mask_position', 'token', 'return_array', 'forgot', 'answer'], |
|
| 527 | + 'setStickerPositionInSet' => ['sticker', 'position', 'token', 'return_array', 'forgot', 'answer'], |
|
| 528 | + 'deleteStickerFromSet' => ['sticker', 'token', 'return_array', 'forgot', 'answer'], |
|
| 529 | + 'setStickerSetThumb' => ['name', 'user_id', 'thumb', 'token', 'return_array', 'forgot', 'answer'], |
|
| 530 | + 'answerInlineQuery' => ['results', 'inline_query_id', 'cache_time', 'is_personal', 'next_offset', 'switch_pm_text', 'switch_pm_parameter', 'token', 'return_array', 'forgot', 'answer'], |
|
| 531 | + 'answerWebAppQuery' => ['web_app_query_id', 'result', 'token', 'return_array', 'forgot', 'answer'], |
|
| 532 | + 'sendInvoice' => ['title', 'description', 'payload', 'provider_token', 'currency', 'prices', 'chat_id', 'max_tip_amount', 'suggested_tip_amounts', 'start_parameter', 'provider_data', 'photo_url', 'photo_size', 'photo_width', 'photo_height', 'need_name', 'need_phone_number', 'need_email', 'need_shipping_address', 'send_phone_number_to_provider', 'send_email_to_provider', 'is_flexible', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 533 | + 'createInvoiceLink' => ['title', 'description', 'payload', 'provider_token', 'currency', 'prices', 'max_tip_amount', 'suggested_tip_amounts', 'provider_data', 'photo_url', 'photo_size', 'photo_width', 'photo_height', 'need_name', 'need_phone_number', 'need_email', 'need_shipping_address', 'send_phone_number_to_provider', 'send_email_to_provider', 'is_flexible', 'token', 'return_array', 'forgot', 'answer'], |
|
| 534 | + 'answerShippingQuery' => ['ok', 'shipping_query_id', 'shipping_options', 'error_message', 'token', 'return_array', 'forgot', 'answer'], |
|
| 535 | + 'answerPreCheckoutQuery' => ['ok', 'pre_checkout_query_id', 'error_message', 'token', 'return_array', 'forgot', 'answer'], |
|
| 536 | + 'setPassportDataErrors' => ['errors', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 537 | + 'sendGame' => ['game_short_name', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
| 538 | + 'setGameScore' => ['score', 'user_id', 'force', 'disable_edit_message', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 539 | + 'getGameHighScores' => ['user_id', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
| 540 | 540 | ]; |
| 541 | 541 | |
| 542 | 542 | private const METHODS_WITH_FILE = [ |
@@ -565,8 +565,8 @@ discard block |
||
| 565 | 565 | 'logOut' => [], |
| 566 | 566 | 'close' => [], |
| 567 | 567 | 'sendMessage' => ['chat_id'], |
| 568 | - 'forwardMessage' => ['from_chat_id','message_id'], |
|
| 569 | - 'copyMessage' => ['from_chat_id','message_id'], |
|
| 568 | + 'forwardMessage' => ['from_chat_id', 'message_id'], |
|
| 569 | + 'copyMessage' => ['from_chat_id', 'message_id'], |
|
| 570 | 570 | 'sendPhoto' => ['chat_id'], |
| 571 | 571 | 'sendAudio' => ['chat_id'], |
| 572 | 572 | 'sendDocument' => ['chat_id'], |
@@ -582,15 +582,15 @@ discard block |
||
| 582 | 582 | 'sendContact' => ['chat_id'], |
| 583 | 583 | 'sendPoll' => ['chat_id'], |
| 584 | 584 | 'sendDice' => ['chat_id'], |
| 585 | - 'sendChatAction' => ['chat_id','action'], |
|
| 585 | + 'sendChatAction' => ['chat_id', 'action'], |
|
| 586 | 586 | 'getUserProfilePhotos' => ['user_id'], |
| 587 | 587 | 'getFile' => ['file_id'], |
| 588 | - 'banChatMember' => ['chat_id','user_id'], |
|
| 589 | - 'kickChatMember' => ['chat_id','user_id'], |
|
| 590 | - 'unbanChatMember' => ['chat_id','user_id'], |
|
| 591 | - 'restrictChatMember' => ['chat_id','user_id'], |
|
| 592 | - 'promoteChatMember' => ['chat_id','user_id'], |
|
| 593 | - 'setChatAdministratorCustomTitle' => ['chat_id','user_id'], |
|
| 588 | + 'banChatMember' => ['chat_id', 'user_id'], |
|
| 589 | + 'kickChatMember' => ['chat_id', 'user_id'], |
|
| 590 | + 'unbanChatMember' => ['chat_id', 'user_id'], |
|
| 591 | + 'restrictChatMember' => ['chat_id', 'user_id'], |
|
| 592 | + 'promoteChatMember' => ['chat_id', 'user_id'], |
|
| 593 | + 'setChatAdministratorCustomTitle' => ['chat_id', 'user_id'], |
|
| 594 | 594 | 'banChatSenderChat' => ['chat_id'], |
| 595 | 595 | 'unbanChatSenderChat' => ['chat_id'], |
| 596 | 596 | 'setChatPermissions' => ['chat_id'], |
@@ -598,8 +598,8 @@ discard block |
||
| 598 | 598 | 'createChatInviteLink' => ['chat_id'], |
| 599 | 599 | 'editChatInviteLink' => ['chat_id'], |
| 600 | 600 | 'revokeChatInviteLink' => ['chat_id'], |
| 601 | - 'approveChatJoinRequest' => ['chat_id','user_id'], |
|
| 602 | - 'declineChatJoinRequest' => ['chat_id','user_id'], |
|
| 601 | + 'approveChatJoinRequest' => ['chat_id', 'user_id'], |
|
| 602 | + 'declineChatJoinRequest' => ['chat_id', 'user_id'], |
|
| 603 | 603 | 'setChatPhoto' => ['chat_id'], |
| 604 | 604 | 'deleteChatPhoto' => ['chat_id'], |
| 605 | 605 | 'setChatTitle' => ['chat_id'], |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | 'getChat' => ['chat_id'], |
| 612 | 612 | 'getChatAdministrators' => ['chat_id'], |
| 613 | 613 | 'getChatMembersCount' => ['chat_id'], |
| 614 | - 'getChatMember' => ['chat_id','user_id'], |
|
| 614 | + 'getChatMember' => ['chat_id', 'user_id'], |
|
| 615 | 615 | 'setChatStickerSet' => ['chat_id'], |
| 616 | 616 | 'deleteChatStickerSet' => ['chat_id'], |
| 617 | 617 | 'answerCallbackQuery' => ['callback_query_id'], |
@@ -622,12 +622,12 @@ discard block |
||
| 622 | 622 | 'getChatMenuButton' => [], |
| 623 | 623 | 'setMyDefaultAdministratorRights' => [], |
| 624 | 624 | 'getMyDefaultAdministratorRights' => [], |
| 625 | - 'editMessageText' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
| 626 | - 'editMessageCaption' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
| 627 | - 'editMessageMedia' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
| 628 | - 'editMessageReplyMarkup' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
| 629 | - 'stopPoll' => ['chat_id','message_id'], |
|
| 630 | - 'deleteMessage' => ['chat_id','message_id'], |
|
| 625 | + 'editMessageText' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
| 626 | + 'editMessageCaption' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
| 627 | + 'editMessageMedia' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
| 628 | + 'editMessageReplyMarkup' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
| 629 | + 'stopPoll' => ['chat_id', 'message_id'], |
|
| 630 | + 'deleteMessage' => ['chat_id', 'message_id'], |
|
| 631 | 631 | 'sendSticker' => ['chat_id'], |
| 632 | 632 | 'getStickerSet' => [], |
| 633 | 633 | 'uploadStickerFile' => ['user_id'], |
@@ -643,8 +643,8 @@ discard block |
||
| 643 | 643 | 'answerPreCheckoutQuery' => ['pre_checkout_query_id'], |
| 644 | 644 | 'setPassportDataErrors' => ['user_id'], |
| 645 | 645 | 'sendGame' => ['chat_id'], |
| 646 | - 'setGameScore' => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
| 647 | - 'getGameHighScores' => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']] |
|
| 646 | + 'setGameScore' => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
| 647 | + 'getGameHighScores' => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']] |
|
| 648 | 648 | ]; |
| 649 | 649 | |
| 650 | 650 | private const METHODS_RETURN = [ |
@@ -696,25 +696,25 @@ discard block |
||
| 696 | 696 | ]; |
| 697 | 697 | |
| 698 | 698 | |
| 699 | - public static function __callStatic (string $name, array $arguments) {
|
|
| 699 | + public static function __callStatic(string $name, array $arguments) {
|
|
| 700 | 700 | if ($action = self::methodAction($name)) {
|
| 701 | - self::keysName($action,$arguments); |
|
| 702 | - self::readyFile($action,$arguments); |
|
| 703 | - self::setDefaults($action,$arguments); |
|
| 701 | + self::keysName($action, $arguments); |
|
| 702 | + self::readyFile($action, $arguments); |
|
| 703 | + self::setDefaults($action, $arguments); |
|
| 704 | 704 | if (isset($arguments['answer'])) {
|
| 705 | - return answer::init($action,$arguments); |
|
| 705 | + return answer::init($action, $arguments); |
|
| 706 | 706 | } |
| 707 | 707 | else {
|
| 708 | - return self::processResponse($action,curl::init($action,$arguments)); |
|
| 708 | + return self::processResponse($action, curl::init($action, $arguments)); |
|
| 709 | 709 | } |
| 710 | 710 | } |
| 711 | 711 | else {
|
| 712 | - logger::write("$name method is not supported",loggerTypes::ERROR);
|
|
| 712 | + logger::write("$name method is not supported", loggerTypes::ERROR);
|
|
| 713 | 713 | throw new bptException('METHOD_NOT_FOUND');
|
| 714 | 714 | } |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | - private static function keysName (string $name, array &$arguments) {
|
|
| 717 | + private static function keysName(string $name, array &$arguments) {
|
|
| 718 | 718 | foreach ($arguments as $key => $argument) {
|
| 719 | 719 | if (is_numeric($key) && isset(self::METHODS_KEYS[$name][$key])) {
|
| 720 | 720 | $arguments[self::METHODS_KEYS[$name][$key]] = $argument; |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | } |
| 724 | 724 | } |
| 725 | 725 | |
| 726 | - private static function methodAction(string $name): string|false {
|
|
| 726 | + private static function methodAction(string $name): string | false {
|
|
| 727 | 727 | return self::METHODS_ACTION[str_replace('_', '', strtolower($name))] ?? false;
|
| 728 | 728 | } |
| 729 | 729 | |
@@ -744,11 +744,11 @@ discard block |
||
| 744 | 744 | } |
| 745 | 745 | } |
| 746 | 746 | |
| 747 | - private static function methodFile(string $name): array|false {
|
|
| 747 | + private static function methodFile(string $name): array | false {
|
|
| 748 | 748 | return self::METHODS_WITH_FILE[$name] ?? false; |
| 749 | 749 | } |
| 750 | 750 | |
| 751 | - private static function methodReturn(string $name,stdClass $response) {
|
|
| 751 | + private static function methodReturn(string $name, stdClass $response) {
|
|
| 752 | 752 | if (isset(self::METHODS_RETURN[$name])) {
|
| 753 | 753 | $return = self::METHODS_RETURN[$name]; |
| 754 | 754 | if (is_array($return)) {
|
@@ -771,13 +771,13 @@ discard block |
||
| 771 | 771 | $defaults = self::METHODS_EXTRA_DEFAULTS[$name]; |
| 772 | 772 | foreach ($defaults as $key => $default) {
|
| 773 | 773 | if (is_numeric($key)) {
|
| 774 | - if (!isset($arguments[$default])){
|
|
| 774 | + if (!isset($arguments[$default])) {
|
|
| 775 | 775 | $arguments[$default] = self::catchFields($default); |
| 776 | 776 | } |
| 777 | 777 | } |
| 778 | 778 | elseif (isset(BPT::$update->$key) || $key === 'other') {
|
| 779 | 779 | foreach ($default as $def) {
|
| 780 | - if (!isset($arguments[$def])){
|
|
| 780 | + if (!isset($arguments[$def])) {
|
|
| 781 | 781 | $arguments[$def] = self::catchFields($def); |
| 782 | 782 | } |
| 783 | 783 | } |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | private static function processResponse(string $name, stdClass $response) {
|
| 790 | 790 | if ($response->ok) {
|
| 791 | 791 | self::$status = true; |
| 792 | - return self::methodReturn($name,$response); |
|
| 792 | + return self::methodReturn($name, $response); |
|
| 793 | 793 | } |
| 794 | 794 | else {
|
| 795 | 795 | self::$status = false; |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | } |
| 798 | 798 | } |
| 799 | 799 | |
| 800 | - public static function catchFields (string $field): int|string|bool {
|
|
| 800 | + public static function catchFields(string $field): int | string | bool {
|
|
| 801 | 801 | switch ($field) {
|
| 802 | 802 | case 'chat_id' : |
| 803 | 803 | case 'from_chat_id' : |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | default => false |
| 934 | 934 | }; |
| 935 | 935 | case 'url' : |
| 936 | - return 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; |
|
| 936 | + return 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
|
| 937 | 937 | default: |
| 938 | 938 | return false; |
| 939 | 939 | } |
@@ -241,18 +241,18 @@ |
||
| 241 | 241 | * @method gameHighScore[]|responseError getGameHighScores (int|null|array $user_id = null, int|null $chat_id = null, int|null $message_id = null, string|null $inline_message_id = null, string|null $token = null, bool|null $return_array = null, bool|null $forgot = null, bool|null $answer = null) Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. |
| 242 | 242 | * @method gameHighScore[]|responseError getGameHigh (int|null|array $user_id = null, int|null $chat_id = null, int|null $message_id = null, string|null $inline_message_id = null, string|null $token = null, bool|null $return_array = null, bool|null $forgot = null, bool|null $answer = null) Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. |
| 243 | 243 | */ |
| 244 | -class BPT extends telegram{
|
|
| 244 | +class BPT extends telegram {
|
|
| 245 | 245 | public static update $update; |
| 246 | 246 | |
| 247 | 247 | public static BPT $handler; |
| 248 | 248 | |
| 249 | 249 | |
| 250 | - public function __construct (array|stdClass $settings) {
|
|
| 250 | + public function __construct(array | stdClass $settings) {
|
|
| 251 | 251 | static::$handler = &$this; |
| 252 | 252 | settings::init($settings); |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | - public static function exit (string|null $message = null) {
|
|
| 255 | + public static function exit (string | null $message = null) {
|
|
| 256 | 256 | die($message ?? "<div style='width:98vw;height:98vh;display:flex;justify-content:center;align-items:center;font-size:25vw'>BPT</div>"); |
| 257 | 257 | } |
| 258 | 258 | } |
@@ -4,4 +4,4 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Exception; |
| 6 | 6 | |
| 7 | -class bptException extends Exception{} |
|
| 8 | 7 | \ No newline at end of file |
| 8 | +class bptException extends Exception {} |
|
| 9 | 9 | \ No newline at end of file |