@@ -217,18 +217,18 @@ discard block |
||
| 217 | 217 | * @method 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. |
| 218 | 218 | * @method 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. |
| 219 | 219 | */ |
| 220 | -class BPT{
|
|
| 220 | +class BPT {
|
|
| 221 | 221 | public static update $update; |
| 222 | 222 | |
| 223 | 223 | public static BPT $handler; |
| 224 | 224 | |
| 225 | 225 | |
| 226 | - public function __construct (array|stdClass $settings) {
|
|
| 226 | + public function __construct(array | stdClass $settings) {
|
|
| 227 | 227 | settings::init($settings); |
| 228 | 228 | static::$handler = &$this; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - public function __call (string $name, array $arguments) {
|
|
| 231 | + public function __call(string $name, array $arguments) {
|
|
| 232 | 232 | if (!isset($arguments[1]) && is_array($arguments[0])) {
|
| 233 | 233 | return request::$name(...$arguments[0]); |
| 234 | 234 | } |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | - public static function exit (string|null $message = null) {
|
|
| 240 | + public static function exit (string | null $message = null) {
|
|
| 241 | 241 | die($message ?? "<div style='width:98vw;height:98vh;display:flex;justify-content:center;align-items:center;font-size:25vw'>BPT</div>"); |
| 242 | 242 | } |
| 243 | 243 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | use CURLFile; |
| 13 | 13 | |
| 14 | 14 | class webhook {
|
| 15 | - public static function init () {
|
|
| 15 | + public static function init() {
|
|
| 16 | 16 | if (settings::$multi) {
|
| 17 | 17 | multi::init(); |
| 18 | 18 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | private static function telegramVerify() {
|
| 33 | 33 | if (settings::$telegram_verify) {
|
| 34 | 34 | if (!tools::isTelegram($_SERVER['REMOTE_ADDR'])) {
|
| 35 | - logger::write('not authorized access denied. IP : '.$_SERVER['REMOTE_ADDR'],'error');
|
|
| 35 | + logger::write('not authorized access denied. IP : '.$_SERVER['REMOTE_ADDR'], 'error');
|
|
| 36 | 36 | BPT::exit(); |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -63,17 +63,17 @@ discard block |
||
| 63 | 63 | private static function setWebhook() {
|
| 64 | 64 | if (isset($_SERVER['SERVER_NAME']) && isset($_SERVER['REQUEST_URI'])) {
|
| 65 | 65 | self::setCertificate(); |
| 66 | - $url = (isset(settings::$certificate) ? 'http://' : 'https://') . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; |
|
| 66 | + $url = (isset(settings::$certificate) ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
|
| 67 | 67 | |
| 68 | 68 | $res = telegram::setWebhook($url, settings::$certificate, max_connections:settings::$max_connection, allowed_updates : settings::$allowed_updates); |
| 69 | 69 | if ($res->ok) {
|
| 70 | 70 | lock::set('BPT');
|
| 71 | - logger::write('Webhook was set successfully','info');
|
|
| 71 | + logger::write('Webhook was set successfully', 'info');
|
|
| 72 | 72 | BPT::exit('Done');
|
| 73 | 73 | } |
| 74 | 74 | else {
|
| 75 | - logger::write("There is some problem happened , telegram response : \n".json_encode($res),'error');
|
|
| 76 | - BPT::exit(print_r($res,true)); |
|
| 75 | + logger::write("There is some problem happened , telegram response : \n".json_encode($res), 'error');
|
|
| 76 | + BPT::exit(print_r($res, true)); |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | else {
|
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - private static function setMessageExtra (update &$update) {
|
|
| 97 | + private static function setMessageExtra(update & $update) {
|
|
| 98 | 98 | if ((isset($update->message) && isset($update->message->text)) || (isset($update->edited_message) && isset($update->edited_message->text))) {
|
| 99 | 99 | $type = isset($update->message) ? 'message' : 'edited_message'; |
| 100 | 100 | $text = &$update->$type->text; |