@@ -212,94 +212,94 @@ discard block |
||
212 | 212 | ]; |
213 | 213 | |
214 | 214 | private const METHODS_KEYS = [ |
215 | - 'getUpdates' => ['offset','limit','timeout','allowed_updates','token','return_array','forgot','answer'], |
|
216 | - 'setWebhook' => ['url','certificate','ip_address','max_connections','allowed_updates','drop_pending_updates','secret_token','token','return_array','forgot','answer'], |
|
217 | - 'deleteWebhook' => ['drop_pending_updates','token','return_array','forgot','answer'], |
|
218 | - 'getWebhookInfo' => ['token','return_array','forgot','answer'], |
|
219 | - 'getMe' => ['token','return_array','forgot','answer'], |
|
220 | - 'logOut' => ['token','return_array','forgot','answer'], |
|
221 | - 'close' => ['token','return_array','forgot','answer'], |
|
222 | - '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'], |
|
223 | - 'forwardMessage' => ['chat_id','from_chat_id','disable_notification','protect_content','message_id','token','return_array','forgot','answer'], |
|
224 | - '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'], |
|
225 | - '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'], |
|
226 | - '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'], |
|
227 | - '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'], |
|
228 | - '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'], |
|
229 | - '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'], |
|
230 | - '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'], |
|
231 | - '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'], |
|
232 | - 'sendMediaGroup' => ['media','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','token','return_array','forgot','answer'], |
|
233 | - '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'], |
|
234 | - 'editMessageLiveLocation' => ['latitude','longitude','chat_id','message_id','inline_message_id','horizontal_accuracy','heading','proximity_alert_radius','reply_markup','token','return_array','forgot','answer'], |
|
235 | - 'stopMessageLiveLocation' => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
|
236 | - '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'], |
|
237 | - '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'], |
|
238 | - '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'], |
|
239 | - 'sendDice' => ['chat_id','emoji','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
240 | - 'sendChatAction' => ['chat_id','action','token','return_array','forgot','answer'], |
|
241 | - 'getUserProfilePhotos' => ['user_id','offset','limit','token','return_array','forgot','answer'], |
|
242 | - 'getFile' => ['file_id','token','return_array','forgot','answer'], |
|
243 | - 'banChatMember' => ['chat_id','user_id','until_date','revoke_messages','token','return_array','forgot','answer'], |
|
244 | - 'unbanChatMember' => ['chat_id','user_id','only_if_banned','token','return_array','forgot','answer'], |
|
245 | - 'restrictChatMember' => ['permissions','chat_id','user_id','until_date','token','return_array','forgot','answer'], |
|
246 | - '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'], |
|
247 | - 'setChatAdministratorCustomTitle' => ['custom_title','chat_id','user_id','token','return_array','forgot','answer'], |
|
248 | - 'banChatSenderChat' => ['sender_chat_id','chat_id','token','return_array','forgot','answer'], |
|
249 | - 'unbanChatSenderChat' => ['sender_chat_id','chat_id','token','return_array','forgot','answer'], |
|
250 | - 'setChatPermissions' => ['permissions','chat_id','token','return_array','forgot','answer'], |
|
251 | - 'exportChatInviteLink' => ['chat_id','token','return_array','forgot','answer'], |
|
252 | - 'createChatInviteLink' => ['chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'], |
|
253 | - 'editChatInviteLink' => ['invite_link','chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'], |
|
254 | - 'revokeChatInviteLink' => ['invite_link','chat_id','token','return_array','forgot','answer'], |
|
255 | - 'approveChatJoinRequest' => ['chat_id','user_id','token','return_array','forgot','answer'], |
|
256 | - 'declineChatJoinRequest' => ['chat_id','user_id','token','return_array','forgot','answer'], |
|
257 | - 'setChatPhoto' => ['photo','chat_id','token','return_array','forgot','answer'], |
|
258 | - 'deleteChatPhoto' => ['chat_id','token','return_array','forgot','answer'], |
|
259 | - 'setChatTitle' => ['title','chat_id','token','return_array','forgot','answer'], |
|
260 | - 'setChatDescription' => ['chat_id','description','token','return_array','forgot','answer'], |
|
261 | - 'pinChatMessage' => ['message_id','chat_id','disable_notification','token','return_array','forgot','answer'], |
|
262 | - 'unpinChatMessage' => ['chat_id','message_id','token','return_array','forgot','answer'], |
|
263 | - 'unpinAllChatMessages' => ['chat_id','token','return_array','forgot','answer'], |
|
264 | - 'leaveChat' => ['chat_id','token','return_array','forgot','answer'], |
|
265 | - 'getChat' => ['chat_id','token','return_array','forgot','answer'], |
|
266 | - 'getChatAdministrators' => ['chat_id','token','return_array','forgot','answer'], |
|
267 | - 'getChatMemberCount' => ['chat_id','token','return_array','forgot','answer'], |
|
268 | - 'getChatMember' => ['chat_id','user_id','token','return_array','forgot','answer'], |
|
269 | - 'setChatStickerSet' => ['sticker_set_name','chat_id','token','return_array','forgot','answer'], |
|
270 | - 'deleteChatStickerSet' => ['chat_id','token','return_array','forgot','answer'], |
|
271 | - 'answerCallbackQuery' => ['callback_query_id','text','show_alert','url','cache_time','token','return_array','forgot','answer'], |
|
272 | - 'setMyCommands' => ['commands','scope','language_code','token','return_array','forgot','answer'], |
|
273 | - 'deleteMyCommands' => ['scope','language_code','token','return_array','forgot','answer'], |
|
274 | - 'getMyCommands' => ['scope','language_code','token','return_array','forgot','answer'], |
|
275 | - 'setChatMenuButton' => ['chat_id','menu_button','token','return_array','forgot','answer'], |
|
276 | - 'getChatMenuButton' => ['chat_id','token','return_array','forgot','answer'], |
|
277 | - 'setMyDefaultAdministratorRights' => ['rights','for_channels','token','return_array','forgot','answer'], |
|
278 | - 'getMyDefaultAdministratorRights' => ['for_channels','token','return_array','forgot','answer'], |
|
279 | - 'editMessageText' => ['text','chat_id','message_id','inline_message_id','parse_mode','entities','disable_web_page_preview','reply_markup','token','return_array','forgot','answer'], |
|
280 | - 'editMessageCaption' => ['chat_id','message_id','inline_message_id','caption','parse_mode','caption_entities','reply_markup','token','return_array','forgot','answer'], |
|
281 | - 'editMessageMedia' => ['media','chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
|
282 | - 'editMessageReplyMarkup' => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
|
283 | - 'stopPoll' => ['chat_id','message_id','reply_markup','token','return_array','forgot','answer'], |
|
284 | - 'deleteMessage' => ['chat_id','message_id','token','return_array','forgot','answer'], |
|
285 | - 'sendSticker' => ['sticker','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
|
286 | - 'getStickerSet' => ['name','token','return_array','forgot','answer'], |
|
287 | - 'uploadStickerFile' => ['png_sticker','user_id','token','return_array','forgot','answer'], |
|
288 | - 'createNewStickerSet' => ['name','title','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','contains_masks','mask_position','token','return_array','forgot','answer'], |
|
289 | - 'addStickerToSet' => ['name','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','mask_position','token','return_array','forgot','answer'], |
|
290 | - 'setStickerPositionInSet' => ['sticker','position','token','return_array','forgot','answer'], |
|
291 | - 'deleteStickerFromSet' => ['sticker','token','return_array','forgot','answer'], |
|
292 | - 'setStickerSetThumb' => ['name','user_id','thumb','token','return_array','forgot','answer'], |
|
293 | - 'answerInlineQuery' => ['results','inline_query_id','cache_time','is_personal','next_offset','switch_pm_text','switch_pm_parameter','token','return_array','forgot','answer'], |
|
294 | - 'answerWebAppQuery' => ['web_app_query_id','result','token','return_array','forgot','answer'], |
|
295 | - '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'], |
|
296 | - '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'], |
|
297 | - 'answerShippingQuery' => ['ok','shipping_query_id','shipping_options','error_message','token','return_array','forgot','answer'], |
|
298 | - 'answerPreCheckoutQuery' => ['ok','pre_checkout_query_id','error_message','token','return_array','forgot','answer'], |
|
299 | - 'setPassportDataErrors' => ['errors','user_id','token','return_array','forgot','answer'], |
|
300 | - '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'], |
|
301 | - 'setGameScore' => ['score','user_id','force','disable_edit_message','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'], |
|
302 | - 'getGameHighScores' => ['user_id','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'], |
|
215 | + 'getUpdates' => ['offset', 'limit', 'timeout', 'allowed_updates', 'token', 'return_array', 'forgot', 'answer'], |
|
216 | + 'setWebhook' => ['url', 'certificate', 'ip_address', 'max_connections', 'allowed_updates', 'drop_pending_updates', 'secret_token', 'token', 'return_array', 'forgot', 'answer'], |
|
217 | + 'deleteWebhook' => ['drop_pending_updates', 'token', 'return_array', 'forgot', 'answer'], |
|
218 | + 'getWebhookInfo' => ['token', 'return_array', 'forgot', 'answer'], |
|
219 | + 'getMe' => ['token', 'return_array', 'forgot', 'answer'], |
|
220 | + 'logOut' => ['token', 'return_array', 'forgot', 'answer'], |
|
221 | + 'close' => ['token', 'return_array', 'forgot', 'answer'], |
|
222 | + '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'], |
|
223 | + 'forwardMessage' => ['chat_id', 'from_chat_id', 'disable_notification', 'protect_content', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
224 | + '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'], |
|
225 | + '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'], |
|
226 | + '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'], |
|
227 | + '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'], |
|
228 | + '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'], |
|
229 | + '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'], |
|
230 | + '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'], |
|
231 | + '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'], |
|
232 | + 'sendMediaGroup' => ['media', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'token', 'return_array', 'forgot', 'answer'], |
|
233 | + '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'], |
|
234 | + 'editMessageLiveLocation' => ['latitude', 'longitude', 'chat_id', 'message_id', 'inline_message_id', 'horizontal_accuracy', 'heading', 'proximity_alert_radius', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
235 | + 'stopMessageLiveLocation' => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
236 | + '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'], |
|
237 | + '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'], |
|
238 | + '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'], |
|
239 | + 'sendDice' => ['chat_id', 'emoji', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
240 | + 'sendChatAction' => ['chat_id', 'action', 'token', 'return_array', 'forgot', 'answer'], |
|
241 | + 'getUserProfilePhotos' => ['user_id', 'offset', 'limit', 'token', 'return_array', 'forgot', 'answer'], |
|
242 | + 'getFile' => ['file_id', 'token', 'return_array', 'forgot', 'answer'], |
|
243 | + 'banChatMember' => ['chat_id', 'user_id', 'until_date', 'revoke_messages', 'token', 'return_array', 'forgot', 'answer'], |
|
244 | + 'unbanChatMember' => ['chat_id', 'user_id', 'only_if_banned', 'token', 'return_array', 'forgot', 'answer'], |
|
245 | + 'restrictChatMember' => ['permissions', 'chat_id', 'user_id', 'until_date', 'token', 'return_array', 'forgot', 'answer'], |
|
246 | + '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'], |
|
247 | + 'setChatAdministratorCustomTitle' => ['custom_title', 'chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
248 | + 'banChatSenderChat' => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
249 | + 'unbanChatSenderChat' => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
250 | + 'setChatPermissions' => ['permissions', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
251 | + 'exportChatInviteLink' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
252 | + 'createChatInviteLink' => ['chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'], |
|
253 | + 'editChatInviteLink' => ['invite_link', 'chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'], |
|
254 | + 'revokeChatInviteLink' => ['invite_link', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
255 | + 'approveChatJoinRequest' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
256 | + 'declineChatJoinRequest' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
257 | + 'setChatPhoto' => ['photo', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
258 | + 'deleteChatPhoto' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
259 | + 'setChatTitle' => ['title', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
260 | + 'setChatDescription' => ['chat_id', 'description', 'token', 'return_array', 'forgot', 'answer'], |
|
261 | + 'pinChatMessage' => ['message_id', 'chat_id', 'disable_notification', 'token', 'return_array', 'forgot', 'answer'], |
|
262 | + 'unpinChatMessage' => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
263 | + 'unpinAllChatMessages' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
264 | + 'leaveChat' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
265 | + 'getChat' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
266 | + 'getChatAdministrators' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
267 | + 'getChatMemberCount' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
268 | + 'getChatMember' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
269 | + 'setChatStickerSet' => ['sticker_set_name', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
270 | + 'deleteChatStickerSet' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
271 | + 'answerCallbackQuery' => ['callback_query_id', 'text', 'show_alert', 'url', 'cache_time', 'token', 'return_array', 'forgot', 'answer'], |
|
272 | + 'setMyCommands' => ['commands', 'scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
273 | + 'deleteMyCommands' => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
274 | + 'getMyCommands' => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
275 | + 'setChatMenuButton' => ['chat_id', 'menu_button', 'token', 'return_array', 'forgot', 'answer'], |
|
276 | + 'getChatMenuButton' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
277 | + 'setMyDefaultAdministratorRights' => ['rights', 'for_channels', 'token', 'return_array', 'forgot', 'answer'], |
|
278 | + 'getMyDefaultAdministratorRights' => ['for_channels', 'token', 'return_array', 'forgot', 'answer'], |
|
279 | + 'editMessageText' => ['text', 'chat_id', 'message_id', 'inline_message_id', 'parse_mode', 'entities', 'disable_web_page_preview', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
280 | + 'editMessageCaption' => ['chat_id', 'message_id', 'inline_message_id', 'caption', 'parse_mode', 'caption_entities', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
281 | + 'editMessageMedia' => ['media', 'chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
282 | + 'editMessageReplyMarkup' => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
283 | + 'stopPoll' => ['chat_id', 'message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
284 | + 'deleteMessage' => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
285 | + 'sendSticker' => ['sticker', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
286 | + 'getStickerSet' => ['name', 'token', 'return_array', 'forgot', 'answer'], |
|
287 | + 'uploadStickerFile' => ['png_sticker', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
288 | + 'createNewStickerSet' => ['name', 'title', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'contains_masks', 'mask_position', 'token', 'return_array', 'forgot', 'answer'], |
|
289 | + 'addStickerToSet' => ['name', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'mask_position', 'token', 'return_array', 'forgot', 'answer'], |
|
290 | + 'setStickerPositionInSet' => ['sticker', 'position', 'token', 'return_array', 'forgot', 'answer'], |
|
291 | + 'deleteStickerFromSet' => ['sticker', 'token', 'return_array', 'forgot', 'answer'], |
|
292 | + 'setStickerSetThumb' => ['name', 'user_id', 'thumb', 'token', 'return_array', 'forgot', 'answer'], |
|
293 | + 'answerInlineQuery' => ['results', 'inline_query_id', 'cache_time', 'is_personal', 'next_offset', 'switch_pm_text', 'switch_pm_parameter', 'token', 'return_array', 'forgot', 'answer'], |
|
294 | + 'answerWebAppQuery' => ['web_app_query_id', 'result', 'token', 'return_array', 'forgot', 'answer'], |
|
295 | + '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'], |
|
296 | + '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'], |
|
297 | + 'answerShippingQuery' => ['ok', 'shipping_query_id', 'shipping_options', 'error_message', 'token', 'return_array', 'forgot', 'answer'], |
|
298 | + 'answerPreCheckoutQuery' => ['ok', 'pre_checkout_query_id', 'error_message', 'token', 'return_array', 'forgot', 'answer'], |
|
299 | + 'setPassportDataErrors' => ['errors', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
300 | + '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'], |
|
301 | + 'setGameScore' => ['score', 'user_id', 'force', 'disable_edit_message', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
302 | + 'getGameHighScores' => ['user_id', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
303 | 303 | ]; |
304 | 304 | |
305 | 305 | private const METHODS_WITH_FILE = [ |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | 'logOut' => [], |
329 | 329 | 'close' => [], |
330 | 330 | 'sendMessage' => ['chat_id'], |
331 | - 'forwardMessage' => ['from_chat_id','message_id'], |
|
332 | - 'copyMessage' => ['from_chat_id','message_id'], |
|
331 | + 'forwardMessage' => ['from_chat_id', 'message_id'], |
|
332 | + 'copyMessage' => ['from_chat_id', 'message_id'], |
|
333 | 333 | 'sendPhoto' => ['chat_id'], |
334 | 334 | 'sendAudio' => ['chat_id'], |
335 | 335 | 'sendDocument' => ['chat_id'], |
@@ -345,15 +345,15 @@ discard block |
||
345 | 345 | 'sendContact' => ['chat_id'], |
346 | 346 | 'sendPoll' => ['chat_id'], |
347 | 347 | 'sendDice' => ['chat_id'], |
348 | - 'sendChatAction' => ['chat_id','action'], |
|
348 | + 'sendChatAction' => ['chat_id', 'action'], |
|
349 | 349 | 'getUserProfilePhotos' => ['user_id'], |
350 | 350 | 'getFile' => ['file_id'], |
351 | - 'banChatMember' => ['chat_id','user_id'], |
|
352 | - 'kickChatMember' => ['chat_id','user_id'], |
|
353 | - 'unbanChatMember' => ['chat_id','user_id'], |
|
354 | - 'restrictChatMember' => ['chat_id','user_id'], |
|
355 | - 'promoteChatMember' => ['chat_id','user_id'], |
|
356 | - 'setChatAdministratorCustomTitle' => ['chat_id','user_id'], |
|
351 | + 'banChatMember' => ['chat_id', 'user_id'], |
|
352 | + 'kickChatMember' => ['chat_id', 'user_id'], |
|
353 | + 'unbanChatMember' => ['chat_id', 'user_id'], |
|
354 | + 'restrictChatMember' => ['chat_id', 'user_id'], |
|
355 | + 'promoteChatMember' => ['chat_id', 'user_id'], |
|
356 | + 'setChatAdministratorCustomTitle' => ['chat_id', 'user_id'], |
|
357 | 357 | 'banChatSenderChat' => ['chat_id'], |
358 | 358 | 'unbanChatSenderChat' => ['chat_id'], |
359 | 359 | 'setChatPermissions' => ['chat_id'], |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | 'createChatInviteLink' => ['chat_id'], |
362 | 362 | 'editChatInviteLink' => ['chat_id'], |
363 | 363 | 'revokeChatInviteLink' => ['chat_id'], |
364 | - 'approveChatJoinRequest' => ['chat_id','user_id'], |
|
365 | - 'declineChatJoinRequest' => ['chat_id','user_id'], |
|
364 | + 'approveChatJoinRequest' => ['chat_id', 'user_id'], |
|
365 | + 'declineChatJoinRequest' => ['chat_id', 'user_id'], |
|
366 | 366 | 'setChatPhoto' => ['chat_id'], |
367 | 367 | 'deleteChatPhoto' => ['chat_id'], |
368 | 368 | 'setChatTitle' => ['chat_id'], |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | 'getChat' => ['chat_id'], |
375 | 375 | 'getChatAdministrators' => ['chat_id'], |
376 | 376 | 'getChatMembersCount' => ['chat_id'], |
377 | - 'getChatMember' => ['chat_id','user_id'], |
|
377 | + 'getChatMember' => ['chat_id', 'user_id'], |
|
378 | 378 | 'setChatStickerSet' => ['chat_id'], |
379 | 379 | 'deleteChatStickerSet' => ['chat_id'], |
380 | 380 | 'answerCallbackQuery' => ['callback_query_id'], |
@@ -385,12 +385,12 @@ discard block |
||
385 | 385 | 'getChatMenuButton' => [], |
386 | 386 | 'setMyDefaultAdministratorRights' => [], |
387 | 387 | 'getMyDefaultAdministratorRights' => [], |
388 | - 'editMessageText' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
389 | - 'editMessageCaption' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
390 | - 'editMessageMedia' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
391 | - 'editMessageReplyMarkup' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
392 | - 'stopPoll' => ['chat_id','message_id'], |
|
393 | - 'deleteMessage' => ['chat_id','message_id'], |
|
388 | + 'editMessageText' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
389 | + 'editMessageCaption' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
390 | + 'editMessageMedia' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
391 | + 'editMessageReplyMarkup' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
392 | + 'stopPoll' => ['chat_id', 'message_id'], |
|
393 | + 'deleteMessage' => ['chat_id', 'message_id'], |
|
394 | 394 | 'sendSticker' => ['chat_id'], |
395 | 395 | 'getStickerSet' => [], |
396 | 396 | 'uploadStickerFile' => ['user_id'], |
@@ -406,29 +406,29 @@ discard block |
||
406 | 406 | 'answerPreCheckoutQuery' => ['pre_checkout_query_id'], |
407 | 407 | 'setPassportDataErrors' => ['user_id'], |
408 | 408 | 'sendGame' => ['chat_id'], |
409 | - 'setGameScore' => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
|
410 | - 'getGameHighScores' => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']] |
|
409 | + 'setGameScore' => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
410 | + 'getGameHighScores' => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']] |
|
411 | 411 | ]; |
412 | 412 | |
413 | 413 | |
414 | - public static function __callStatic (string $name, array $arguments) { |
|
414 | + public static function __callStatic(string $name, array $arguments) { |
|
415 | 415 | if ($action = self::methodAction($name)) { |
416 | - self::keysName($action,$arguments); |
|
417 | - self::readyFile($action,$arguments); |
|
418 | - self::setDefaults($action,$arguments); |
|
416 | + self::keysName($action, $arguments); |
|
417 | + self::readyFile($action, $arguments); |
|
418 | + self::setDefaults($action, $arguments); |
|
419 | 419 | if (isset($arguments['answer'])) { |
420 | - return answer::init($action,$arguments); |
|
420 | + return answer::init($action, $arguments); |
|
421 | 421 | } |
422 | 422 | else { |
423 | - return curl::init($action,$arguments); |
|
423 | + return curl::init($action, $arguments); |
|
424 | 424 | } |
425 | 425 | } |
426 | 426 | else { |
427 | - logger::write("$name method is not supported",loggerTypes::ERROR); |
|
427 | + logger::write("$name method is not supported", loggerTypes::ERROR); |
|
428 | 428 | } |
429 | 429 | } |
430 | 430 | |
431 | - private static function keysName (string $name, array &$arguments) { |
|
431 | + private static function keysName(string $name, array &$arguments) { |
|
432 | 432 | foreach ($arguments as $key => $argument) { |
433 | 433 | if (is_numeric($key) && isset(self::METHODS_KEYS[$name][$key])) { |
434 | 434 | $arguments[self::METHODS_KEYS[$name][$key]] = $argument; |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | } |
438 | 438 | } |
439 | 439 | |
440 | - private static function methodAction(string $name): string|false { |
|
440 | + private static function methodAction(string $name): string | false { |
|
441 | 441 | return self::METHODS_ACTION[str_replace('_', '', strtolower($name))] ?? false; |
442 | 442 | } |
443 | 443 | |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | } |
459 | 459 | } |
460 | 460 | |
461 | - private static function methodFile(string $name): array|false { |
|
461 | + private static function methodFile(string $name): array | false { |
|
462 | 462 | return self::METHODS_WITH_FILE[$name] ?? false; |
463 | 463 | } |
464 | 464 | |
@@ -466,13 +466,13 @@ discard block |
||
466 | 466 | $defaults = self::METHODS_EXTRA_DEFAULTS[$name]; |
467 | 467 | foreach ($defaults as $key => $default) { |
468 | 468 | if (is_numeric($key)) { |
469 | - if (!isset($arguments[$default])){ |
|
469 | + if (!isset($arguments[$default])) { |
|
470 | 470 | $arguments[$default] = self::catchFields($default); |
471 | 471 | } |
472 | 472 | } |
473 | 473 | elseif (isset(BPT::$update->$key) || $key === 'other') { |
474 | 474 | foreach ($default as $def) { |
475 | - if (!isset($arguments[$def])){ |
|
475 | + if (!isset($arguments[$def])) { |
|
476 | 476 | $arguments[$def] = self::catchFields($def); |
477 | 477 | } |
478 | 478 | } |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | } |
482 | 482 | } |
483 | 483 | |
484 | - public static function catchFields (string $field): int|string|bool { |
|
484 | + public static function catchFields(string $field): int | string | bool { |
|
485 | 485 | switch ($field) { |
486 | 486 | case 'chat_id' : |
487 | 487 | case 'from_chat_id' : |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | default => false |
618 | 618 | }; |
619 | 619 | case 'url' : |
620 | - return 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; |
|
620 | + return 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
|
621 | 621 | default: |
622 | 622 | return false; |
623 | 623 | } |
@@ -418,12 +418,10 @@ discard block |
||
418 | 418 | self::setDefaults($action,$arguments); |
419 | 419 | if (isset($arguments['answer'])) { |
420 | 420 | return answer::init($action,$arguments); |
421 | - } |
|
422 | - else { |
|
421 | + } else { |
|
423 | 422 | return curl::init($action,$arguments); |
424 | 423 | } |
425 | - } |
|
426 | - else { |
|
424 | + } else { |
|
427 | 425 | logger::write("$name method is not supported",loggerTypes::ERROR); |
428 | 426 | } |
429 | 427 | } |
@@ -448,8 +446,7 @@ discard block |
||
448 | 446 | $arguments['media'][$key]['media'] = new CURLFile($media['media']); |
449 | 447 | } |
450 | 448 | } |
451 | - } |
|
452 | - elseif ($file_params = self::methodFile($name)) { |
|
449 | + } elseif ($file_params = self::methodFile($name)) { |
|
453 | 450 | foreach ($file_params as $param) { |
454 | 451 | if (isset($arguments[$param]) && file_exists($arguments[$param])) { |
455 | 452 | $arguments[$param] = new CURLFile($arguments[$param]); |
@@ -469,8 +466,7 @@ discard block |
||
469 | 466 | if (!isset($arguments[$default])){ |
470 | 467 | $arguments[$default] = self::catchFields($default); |
471 | 468 | } |
472 | - } |
|
473 | - elseif (isset(BPT::$update->$key) || $key === 'other') { |
|
469 | + } elseif (isset(BPT::$update->$key) || $key === 'other') { |
|
474 | 470 | foreach ($default as $def) { |
475 | 471 | if (!isset($arguments[$def])){ |
476 | 472 | $arguments[$def] = self::catchFields($def); |
@@ -510,9 +506,13 @@ discard block |
||
510 | 506 | default => false |
511 | 507 | }; |
512 | 508 | case 'file_id' : |
513 | - if (isset(BPT::$update->message)) $type = 'message'; |
|
514 | - elseif (isset(BPT::$update->edited_message)) $type = 'edited_message'; |
|
515 | - else return false; |
|
509 | + if (isset(BPT::$update->message)) { |
|
510 | + $type = 'message'; |
|
511 | + } elseif (isset(BPT::$update->edited_message)) { |
|
512 | + $type = 'edited_message'; |
|
513 | + } else { |
|
514 | + return false; |
|
515 | + } |
|
516 | 516 | |
517 | 517 | return match(true) { |
518 | 518 | isset(BPT::$update->$type->animation) => BPT::$update->$type->animation->file_id, |
@@ -219,18 +219,18 @@ discard block |
||
219 | 219 | * @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. |
220 | 220 | * @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. |
221 | 221 | */ |
222 | -class BPT{ |
|
222 | +class BPT { |
|
223 | 223 | public static update $update; |
224 | 224 | |
225 | 225 | public static BPT $handler; |
226 | 226 | |
227 | 227 | |
228 | - public function __construct (array|stdClass $settings) { |
|
228 | + public function __construct(array | stdClass $settings) { |
|
229 | 229 | static::$handler = &$this; |
230 | 230 | settings::init($settings); |
231 | 231 | } |
232 | 232 | |
233 | - public function __call (string $name, array $arguments) { |
|
233 | + public function __call(string $name, array $arguments) { |
|
234 | 234 | if (!isset($arguments[1]) && isset($arguments[0]) && is_array($arguments[0])) { |
235 | 235 | return request::$name(...$arguments[0]); |
236 | 236 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | } |
240 | 240 | } |
241 | 241 | |
242 | - public static function exit (string|null $message = null) { |
|
242 | + public static function exit (string | null $message = null) { |
|
243 | 243 | die($message ?? "<div style='width:98vw;height:98vh;display:flex;justify-content:center;align-items:center;font-size:25vw'>BPT</div>"); |
244 | 244 | } |
245 | 245 | } |
@@ -233,8 +233,7 @@ |
||
233 | 233 | public function __call (string $name, array $arguments) { |
234 | 234 | if (!isset($arguments[1]) && isset($arguments[0]) && is_array($arguments[0])) { |
235 | 235 | return request::$name(...$arguments[0]); |
236 | - } |
|
237 | - else { |
|
236 | + } else { |
|
238 | 237 | return request::$name(...$arguments); |
239 | 238 | } |
240 | 239 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | public static int $log_size = 10; |
24 | 24 | |
25 | - public static string|CURLFile|null $certificate = null; |
|
25 | + public static string | CURLFile | null $certificate = null; |
|
26 | 26 | |
27 | 27 | public static bool $handler = true; |
28 | 28 | |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | |
53 | 53 | public static array $allowed_updates = ['message', 'edited_channel_post', 'callback_query', 'inline_query']; |
54 | 54 | |
55 | - public static array|mysqli|null $db = ['type' => 'json', 'file_name' => 'BPT-DB.json']; |
|
55 | + public static array | mysqli | null $db = ['type' => 'json', 'file_name' => 'BPT-DB.json']; |
|
56 | 56 | |
57 | 57 | |
58 | - public static function init (array|stdClass $settings) { |
|
58 | + public static function init(array | stdClass $settings) { |
|
59 | 59 | $settings = (array) $settings; |
60 | 60 | |
61 | 61 | if (!(isset($settings['logger']) && $settings['logger'] == false)) { |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | foreach ($settings as $setting => $value) { |
66 | - try{ |
|
66 | + try { |
|
67 | 67 | self::$$setting = $value; |
68 | 68 | } |
69 | - catch (TypeError){ |
|
70 | - logger::write("$setting setting has wrong type , its set to default value",loggerTypes::WARNING); |
|
69 | + catch (TypeError) { |
|
70 | + logger::write("$setting setting has wrong type , its set to default value", loggerTypes::WARNING); |
|
71 | 71 | } |
72 | - catch (Error){ |
|
73 | - logger::write("$setting setting is not one of library settings",loggerTypes::WARNING); |
|
72 | + catch (Error) { |
|
73 | + logger::write("$setting setting is not one of library settings", loggerTypes::WARNING); |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | self::$receiver !== receiver::GETUPDATES ? self::webhook() : self::getUpdates(); |
83 | 83 | } |
84 | 84 | else { |
85 | - logger::write('token format is not right, check it and try again',loggerTypes::ERROR); |
|
85 | + logger::write('token format is not right, check it and try again', loggerTypes::ERROR); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | else { |
89 | - logger::write('You must specify token parameter in settings',loggerTypes::ERROR); |
|
89 | + logger::write('You must specify token parameter in settings', loggerTypes::ERROR); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if (self::$secure_folder) { |
110 | 110 | $address = explode('/', $_SERVER['REQUEST_URI']); |
111 | 111 | unset($address[count($address) - 1]); |
112 | - $address = implode('/', $address) . '/BPT.php'; |
|
112 | + $address = implode('/', $address).'/BPT.php'; |
|
113 | 113 | $text = "ErrorDocument 404 $address\nErrorDocument 403 $address\n Options -Indexes\n Order Deny,Allow\nDeny from all\nAllow from 127.0.0.1\n<Files *.php>\n Order Allow,Deny\n Allow from all\n</Files>"; |
114 | 114 | if (!file_exists('.htaccess') || filesize('.htaccess') != strlen($text)) { |
115 | 115 | file_put_contents('.htaccess', $text); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | getUpdates::init(); |
129 | 129 | } |
130 | 130 | else { |
131 | - logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler',loggerTypes::ERROR); |
|
131 | + logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler', loggerTypes::ERROR); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 |
@@ -65,11 +65,9 @@ discard block |
||
65 | 65 | foreach ($settings as $setting => $value) { |
66 | 66 | try{ |
67 | 67 | self::$$setting = $value; |
68 | - } |
|
69 | - catch (TypeError){ |
|
68 | + } catch (TypeError){ |
|
70 | 69 | logger::write("$setting setting has wrong type , its set to default value",loggerTypes::WARNING); |
71 | - } |
|
72 | - catch (Error){ |
|
70 | + } catch (Error){ |
|
73 | 71 | logger::write("$setting setting is not one of library settings",loggerTypes::WARNING); |
74 | 72 | } |
75 | 73 | } |
@@ -80,12 +78,10 @@ discard block |
||
80 | 78 | self::secureFolder(); |
81 | 79 | self::db(); |
82 | 80 | self::$receiver !== receiver::GETUPDATES ? self::webhook() : self::getUpdates(); |
83 | - } |
|
84 | - else { |
|
81 | + } else { |
|
85 | 82 | logger::write('token format is not right, check it and try again',loggerTypes::ERROR); |
86 | 83 | } |
87 | - } |
|
88 | - else { |
|
84 | + } else { |
|
89 | 85 | logger::write('You must specify token parameter in settings',loggerTypes::ERROR); |
90 | 86 | } |
91 | 87 | } |
@@ -126,8 +122,7 @@ discard block |
||
126 | 122 | private static function getUpdates() { |
127 | 123 | if (self::$handler) { |
128 | 124 | getUpdates::init(); |
129 | - } |
|
130 | - else { |
|
125 | + } else { |
|
131 | 126 | logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler',loggerTypes::ERROR); |
132 | 127 | } |
133 | 128 | } |