|
@@ -454,95 +454,95 @@ discard block |
|
|
block discarded – undo |
454
|
454
|
]; |
455
|
455
|
|
456
|
456
|
private const METHODS_KEYS = [ |
457
|
|
- 'getUpdates' => ['offset','limit','timeout','allowed_updates','token','return_array','forgot','answer'], |
458
|
|
- 'setWebhook' => ['url','certificate','ip_address','max_connections','allowed_updates','drop_pending_updates','secret_token','token','return_array','forgot','answer'], |
459
|
|
- 'deleteWebhook' => ['drop_pending_updates','token','return_array','forgot','answer'], |
460
|
|
- 'getWebhookInfo' => ['token','return_array','forgot','answer'], |
461
|
|
- 'getMe' => ['token','return_array','forgot','answer'], |
462
|
|
- 'logOut' => ['token','return_array','forgot','answer'], |
463
|
|
- 'close' => ['token','return_array','forgot','answer'], |
464
|
|
- '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'], |
465
|
|
- 'forwardMessage' => ['chat_id','from_chat_id','disable_notification','protect_content','message_id','token','return_array','forgot','answer'], |
466
|
|
- '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'], |
467
|
|
- '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'], |
468
|
|
- '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'], |
469
|
|
- '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'], |
470
|
|
- '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'], |
471
|
|
- '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'], |
472
|
|
- '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'], |
473
|
|
- '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'], |
474
|
|
- 'sendMediaGroup' => ['media','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','token','return_array','forgot','answer'], |
475
|
|
- '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'], |
476
|
|
- 'editMessageLiveLocation' => ['latitude','longitude','chat_id','message_id','inline_message_id','horizontal_accuracy','heading','proximity_alert_radius','reply_markup','token','return_array','forgot','answer'], |
477
|
|
- 'stopMessageLiveLocation' => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
478
|
|
- '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'], |
479
|
|
- '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'], |
480
|
|
- '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'], |
481
|
|
- 'sendDice' => ['chat_id','emoji','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
482
|
|
- 'sendChatAction' => ['chat_id','action','token','return_array','forgot','answer'], |
483
|
|
- 'getUserProfilePhotos' => ['user_id','offset','limit','token','return_array','forgot','answer'], |
484
|
|
- 'getFile' => ['file_id','token','return_array','forgot','answer'], |
485
|
|
- 'banChatMember' => ['chat_id','user_id','until_date','revoke_messages','token','return_array','forgot','answer'], |
486
|
|
- 'unbanChatMember' => ['chat_id','user_id','only_if_banned','token','return_array','forgot','answer'], |
487
|
|
- 'restrictChatMember' => ['permissions','chat_id','user_id','until_date','token','return_array','forgot','answer'], |
488
|
|
- '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'], |
489
|
|
- 'setChatAdministratorCustomTitle' => ['custom_title','chat_id','user_id','token','return_array','forgot','answer'], |
490
|
|
- 'banChatSenderChat' => ['sender_chat_id','chat_id','token','return_array','forgot','answer'], |
491
|
|
- 'unbanChatSenderChat' => ['sender_chat_id','chat_id','token','return_array','forgot','answer'], |
492
|
|
- 'setChatPermissions' => ['permissions','chat_id','token','return_array','forgot','answer'], |
493
|
|
- 'exportChatInviteLink' => ['chat_id','token','return_array','forgot','answer'], |
494
|
|
- 'createChatInviteLink' => ['chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'], |
495
|
|
- 'editChatInviteLink' => ['invite_link','chat_id','name','expire_date','member_limit','creates_join_request','token','return_array','forgot','answer'], |
496
|
|
- 'revokeChatInviteLink' => ['invite_link','chat_id','token','return_array','forgot','answer'], |
497
|
|
- 'approveChatJoinRequest' => ['chat_id','user_id','token','return_array','forgot','answer'], |
498
|
|
- 'declineChatJoinRequest' => ['chat_id','user_id','token','return_array','forgot','answer'], |
499
|
|
- 'setChatPhoto' => ['photo','chat_id','token','return_array','forgot','answer'], |
500
|
|
- 'deleteChatPhoto' => ['chat_id','token','return_array','forgot','answer'], |
501
|
|
- 'setChatTitle' => ['title','chat_id','token','return_array','forgot','answer'], |
502
|
|
- 'setChatDescription' => ['chat_id','description','token','return_array','forgot','answer'], |
503
|
|
- 'pinChatMessage' => ['message_id','chat_id','disable_notification','token','return_array','forgot','answer'], |
504
|
|
- 'unpinChatMessage' => ['chat_id','message_id','token','return_array','forgot','answer'], |
505
|
|
- 'unpinAllChatMessages' => ['chat_id','token','return_array','forgot','answer'], |
506
|
|
- 'leaveChat' => ['chat_id','token','return_array','forgot','answer'], |
507
|
|
- 'getChat' => ['chat_id','token','return_array','forgot','answer'], |
508
|
|
- 'getChatAdministrators' => ['chat_id','token','return_array','forgot','answer'], |
509
|
|
- 'getChatMemberCount' => ['chat_id','token','return_array','forgot','answer'], |
510
|
|
- 'getChatMember' => ['chat_id','user_id','token','return_array','forgot','answer'], |
511
|
|
- 'setChatStickerSet' => ['sticker_set_name','chat_id','token','return_array','forgot','answer'], |
512
|
|
- 'deleteChatStickerSet' => ['chat_id','token','return_array','forgot','answer'], |
513
|
|
- 'answerCallbackQuery' => ['callback_query_id','text','show_alert','url','cache_time','token','return_array','forgot','answer'], |
514
|
|
- 'setMyCommands' => ['commands','scope','language_code','token','return_array','forgot','answer'], |
515
|
|
- 'deleteMyCommands' => ['scope','language_code','token','return_array','forgot','answer'], |
516
|
|
- 'getMyCommands' => ['scope','language_code','token','return_array','forgot','answer'], |
517
|
|
- 'setChatMenuButton' => ['chat_id','menu_button','token','return_array','forgot','answer'], |
518
|
|
- 'getChatMenuButton' => ['chat_id','token','return_array','forgot','answer'], |
519
|
|
- 'setMyDefaultAdministratorRights' => ['rights','for_channels','token','return_array','forgot','answer'], |
520
|
|
- 'getMyDefaultAdministratorRights' => ['for_channels','token','return_array','forgot','answer'], |
521
|
|
- 'editMessageText' => ['text','chat_id','message_id','inline_message_id','parse_mode','entities','disable_web_page_preview','reply_markup','token','return_array','forgot','answer'], |
522
|
|
- 'editMessageCaption' => ['chat_id','message_id','inline_message_id','caption','parse_mode','caption_entities','reply_markup','token','return_array','forgot','answer'], |
523
|
|
- 'editMessageMedia' => ['media','chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
524
|
|
- 'editMessageReplyMarkup' => ['chat_id','message_id','inline_message_id','reply_markup','token','return_array','forgot','answer'], |
525
|
|
- 'stopPoll' => ['chat_id','message_id','reply_markup','token','return_array','forgot','answer'], |
526
|
|
- 'deleteMessage' => ['chat_id','message_id','token','return_array','forgot','answer'], |
527
|
|
- 'sendSticker' => ['sticker','chat_id','disable_notification','protect_content','reply_to_message_id','allow_sending_without_reply','reply_markup','token','return_array','forgot','answer'], |
528
|
|
- 'getStickerSet' => ['name','token','return_array','forgot','answer'], |
|
457
|
+ 'getUpdates' => ['offset', 'limit', 'timeout', 'allowed_updates', 'token', 'return_array', 'forgot', 'answer'], |
|
458
|
+ 'setWebhook' => ['url', 'certificate', 'ip_address', 'max_connections', 'allowed_updates', 'drop_pending_updates', 'secret_token', 'token', 'return_array', 'forgot', 'answer'], |
|
459
|
+ 'deleteWebhook' => ['drop_pending_updates', 'token', 'return_array', 'forgot', 'answer'], |
|
460
|
+ 'getWebhookInfo' => ['token', 'return_array', 'forgot', 'answer'], |
|
461
|
+ 'getMe' => ['token', 'return_array', 'forgot', 'answer'], |
|
462
|
+ 'logOut' => ['token', 'return_array', 'forgot', 'answer'], |
|
463
|
+ 'close' => ['token', 'return_array', 'forgot', 'answer'], |
|
464
|
+ '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'], |
|
465
|
+ 'forwardMessage' => ['chat_id', 'from_chat_id', 'disable_notification', 'protect_content', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
466
|
+ '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'], |
|
467
|
+ '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'], |
|
468
|
+ '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'], |
|
469
|
+ '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'], |
|
470
|
+ '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'], |
|
471
|
+ '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'], |
|
472
|
+ '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'], |
|
473
|
+ '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'], |
|
474
|
+ 'sendMediaGroup' => ['media', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'token', 'return_array', 'forgot', 'answer'], |
|
475
|
+ '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'], |
|
476
|
+ 'editMessageLiveLocation' => ['latitude', 'longitude', 'chat_id', 'message_id', 'inline_message_id', 'horizontal_accuracy', 'heading', 'proximity_alert_radius', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
477
|
+ 'stopMessageLiveLocation' => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
478
|
+ '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'], |
|
479
|
+ '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'], |
|
480
|
+ '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'], |
|
481
|
+ 'sendDice' => ['chat_id', 'emoji', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
482
|
+ 'sendChatAction' => ['chat_id', 'action', 'token', 'return_array', 'forgot', 'answer'], |
|
483
|
+ 'getUserProfilePhotos' => ['user_id', 'offset', 'limit', 'token', 'return_array', 'forgot', 'answer'], |
|
484
|
+ 'getFile' => ['file_id', 'token', 'return_array', 'forgot', 'answer'], |
|
485
|
+ 'banChatMember' => ['chat_id', 'user_id', 'until_date', 'revoke_messages', 'token', 'return_array', 'forgot', 'answer'], |
|
486
|
+ 'unbanChatMember' => ['chat_id', 'user_id', 'only_if_banned', 'token', 'return_array', 'forgot', 'answer'], |
|
487
|
+ 'restrictChatMember' => ['permissions', 'chat_id', 'user_id', 'until_date', 'token', 'return_array', 'forgot', 'answer'], |
|
488
|
+ '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'], |
|
489
|
+ 'setChatAdministratorCustomTitle' => ['custom_title', 'chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
490
|
+ 'banChatSenderChat' => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
491
|
+ 'unbanChatSenderChat' => ['sender_chat_id', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
492
|
+ 'setChatPermissions' => ['permissions', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
493
|
+ 'exportChatInviteLink' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
494
|
+ 'createChatInviteLink' => ['chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'], |
|
495
|
+ 'editChatInviteLink' => ['invite_link', 'chat_id', 'name', 'expire_date', 'member_limit', 'creates_join_request', 'token', 'return_array', 'forgot', 'answer'], |
|
496
|
+ 'revokeChatInviteLink' => ['invite_link', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
497
|
+ 'approveChatJoinRequest' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
498
|
+ 'declineChatJoinRequest' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
499
|
+ 'setChatPhoto' => ['photo', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
500
|
+ 'deleteChatPhoto' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
501
|
+ 'setChatTitle' => ['title', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
502
|
+ 'setChatDescription' => ['chat_id', 'description', 'token', 'return_array', 'forgot', 'answer'], |
|
503
|
+ 'pinChatMessage' => ['message_id', 'chat_id', 'disable_notification', 'token', 'return_array', 'forgot', 'answer'], |
|
504
|
+ 'unpinChatMessage' => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
505
|
+ 'unpinAllChatMessages' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
506
|
+ 'leaveChat' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
507
|
+ 'getChat' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
508
|
+ 'getChatAdministrators' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
509
|
+ 'getChatMemberCount' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
510
|
+ 'getChatMember' => ['chat_id', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
511
|
+ 'setChatStickerSet' => ['sticker_set_name', 'chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
512
|
+ 'deleteChatStickerSet' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
513
|
+ 'answerCallbackQuery' => ['callback_query_id', 'text', 'show_alert', 'url', 'cache_time', 'token', 'return_array', 'forgot', 'answer'], |
|
514
|
+ 'setMyCommands' => ['commands', 'scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
515
|
+ 'deleteMyCommands' => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
516
|
+ 'getMyCommands' => ['scope', 'language_code', 'token', 'return_array', 'forgot', 'answer'], |
|
517
|
+ 'setChatMenuButton' => ['chat_id', 'menu_button', 'token', 'return_array', 'forgot', 'answer'], |
|
518
|
+ 'getChatMenuButton' => ['chat_id', 'token', 'return_array', 'forgot', 'answer'], |
|
519
|
+ 'setMyDefaultAdministratorRights' => ['rights', 'for_channels', 'token', 'return_array', 'forgot', 'answer'], |
|
520
|
+ 'getMyDefaultAdministratorRights' => ['for_channels', 'token', 'return_array', 'forgot', 'answer'], |
|
521
|
+ 'editMessageText' => ['text', 'chat_id', 'message_id', 'inline_message_id', 'parse_mode', 'entities', 'disable_web_page_preview', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
522
|
+ 'editMessageCaption' => ['chat_id', 'message_id', 'inline_message_id', 'caption', 'parse_mode', 'caption_entities', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
523
|
+ 'editMessageMedia' => ['media', 'chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
524
|
+ 'editMessageReplyMarkup' => ['chat_id', 'message_id', 'inline_message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
525
|
+ 'stopPoll' => ['chat_id', 'message_id', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
526
|
+ 'deleteMessage' => ['chat_id', 'message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
527
|
+ 'sendSticker' => ['sticker', 'chat_id', 'disable_notification', 'protect_content', 'reply_to_message_id', 'allow_sending_without_reply', 'reply_markup', 'token', 'return_array', 'forgot', 'answer'], |
|
528
|
+ 'getStickerSet' => ['name', 'token', 'return_array', 'forgot', 'answer'], |
529
|
529
|
"getCustomEmojiStickers" => ["custom_emoji_ids", "token", "return_array", "forgot", "answer"], |
530
|
|
- 'uploadStickerFile' => ['png_sticker','user_id','token','return_array','forgot','answer'], |
531
|
|
- 'createNewStickerSet' => ['name','title','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','sticker_type','contains_masks','mask_position','token','return_array','forgot','answer'], |
532
|
|
- 'addStickerToSet' => ['name','emojis','user_id','png_sticker','tgs_sticker','webm_sticker','mask_position','token','return_array','forgot','answer'], |
533
|
|
- 'setStickerPositionInSet' => ['sticker','position','token','return_array','forgot','answer'], |
534
|
|
- 'deleteStickerFromSet' => ['sticker','token','return_array','forgot','answer'], |
535
|
|
- 'setStickerSetThumb' => ['name','user_id','thumb','token','return_array','forgot','answer'], |
536
|
|
- 'answerInlineQuery' => ['results','inline_query_id','cache_time','is_personal','next_offset','switch_pm_text','switch_pm_parameter','token','return_array','forgot','answer'], |
537
|
|
- 'answerWebAppQuery' => ['web_app_query_id','result','token','return_array','forgot','answer'], |
538
|
|
- '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'], |
539
|
|
- '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'], |
540
|
|
- 'answerShippingQuery' => ['ok','shipping_query_id','shipping_options','error_message','token','return_array','forgot','answer'], |
541
|
|
- 'answerPreCheckoutQuery' => ['ok','pre_checkout_query_id','error_message','token','return_array','forgot','answer'], |
542
|
|
- 'setPassportDataErrors' => ['errors','user_id','token','return_array','forgot','answer'], |
543
|
|
- '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'], |
544
|
|
- 'setGameScore' => ['score','user_id','force','disable_edit_message','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'], |
545
|
|
- 'getGameHighScores' => ['user_id','chat_id','message_id','inline_message_id','token','return_array','forgot','answer'], |
|
530
|
+ 'uploadStickerFile' => ['png_sticker', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
531
|
+ 'createNewStickerSet' => ['name', 'title', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'sticker_type', 'contains_masks', 'mask_position', 'token', 'return_array', 'forgot', 'answer'], |
|
532
|
+ 'addStickerToSet' => ['name', 'emojis', 'user_id', 'png_sticker', 'tgs_sticker', 'webm_sticker', 'mask_position', 'token', 'return_array', 'forgot', 'answer'], |
|
533
|
+ 'setStickerPositionInSet' => ['sticker', 'position', 'token', 'return_array', 'forgot', 'answer'], |
|
534
|
+ 'deleteStickerFromSet' => ['sticker', 'token', 'return_array', 'forgot', 'answer'], |
|
535
|
+ 'setStickerSetThumb' => ['name', 'user_id', 'thumb', 'token', 'return_array', 'forgot', 'answer'], |
|
536
|
+ 'answerInlineQuery' => ['results', 'inline_query_id', 'cache_time', 'is_personal', 'next_offset', 'switch_pm_text', 'switch_pm_parameter', 'token', 'return_array', 'forgot', 'answer'], |
|
537
|
+ 'answerWebAppQuery' => ['web_app_query_id', 'result', 'token', 'return_array', 'forgot', 'answer'], |
|
538
|
+ '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'], |
|
539
|
+ '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'], |
|
540
|
+ 'answerShippingQuery' => ['ok', 'shipping_query_id', 'shipping_options', 'error_message', 'token', 'return_array', 'forgot', 'answer'], |
|
541
|
+ 'answerPreCheckoutQuery' => ['ok', 'pre_checkout_query_id', 'error_message', 'token', 'return_array', 'forgot', 'answer'], |
|
542
|
+ 'setPassportDataErrors' => ['errors', 'user_id', 'token', 'return_array', 'forgot', 'answer'], |
|
543
|
+ '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'], |
|
544
|
+ 'setGameScore' => ['score', 'user_id', 'force', 'disable_edit_message', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'], |
|
545
|
+ 'getGameHighScores' => ['user_id', 'chat_id', 'message_id', 'inline_message_id', 'token', 'return_array', 'forgot', 'answer'], |
546
|
546
|
]; |
547
|
547
|
|
548
|
548
|
private const METHODS_WITH_FILE = [ |
|
@@ -571,8 +571,8 @@ discard block |
|
|
block discarded – undo |
571
|
571
|
'logOut' => [], |
572
|
572
|
'close' => [], |
573
|
573
|
'sendMessage' => ['chat_id'], |
574
|
|
- 'forwardMessage' => ['from_chat_id','message_id'], |
575
|
|
- 'copyMessage' => ['from_chat_id','message_id'], |
|
574
|
+ 'forwardMessage' => ['from_chat_id', 'message_id'], |
|
575
|
+ 'copyMessage' => ['from_chat_id', 'message_id'], |
576
|
576
|
'sendPhoto' => ['chat_id'], |
577
|
577
|
'sendAudio' => ['chat_id'], |
578
|
578
|
'sendDocument' => ['chat_id'], |
|
@@ -588,15 +588,15 @@ discard block |
|
|
block discarded – undo |
588
|
588
|
'sendContact' => ['chat_id'], |
589
|
589
|
'sendPoll' => ['chat_id'], |
590
|
590
|
'sendDice' => ['chat_id'], |
591
|
|
- 'sendChatAction' => ['chat_id','action'], |
|
591
|
+ 'sendChatAction' => ['chat_id', 'action'], |
592
|
592
|
'getUserProfilePhotos' => ['user_id'], |
593
|
593
|
'getFile' => ['file_id'], |
594
|
|
- 'banChatMember' => ['chat_id','user_id'], |
595
|
|
- 'kickChatMember' => ['chat_id','user_id'], |
596
|
|
- 'unbanChatMember' => ['chat_id','user_id'], |
597
|
|
- 'restrictChatMember' => ['chat_id','user_id'], |
598
|
|
- 'promoteChatMember' => ['chat_id','user_id'], |
599
|
|
- 'setChatAdministratorCustomTitle' => ['chat_id','user_id'], |
|
594
|
+ 'banChatMember' => ['chat_id', 'user_id'], |
|
595
|
+ 'kickChatMember' => ['chat_id', 'user_id'], |
|
596
|
+ 'unbanChatMember' => ['chat_id', 'user_id'], |
|
597
|
+ 'restrictChatMember' => ['chat_id', 'user_id'], |
|
598
|
+ 'promoteChatMember' => ['chat_id', 'user_id'], |
|
599
|
+ 'setChatAdministratorCustomTitle' => ['chat_id', 'user_id'], |
600
|
600
|
'banChatSenderChat' => ['chat_id'], |
601
|
601
|
'unbanChatSenderChat' => ['chat_id'], |
602
|
602
|
'setChatPermissions' => ['chat_id'], |
|
@@ -604,8 +604,8 @@ discard block |
|
|
block discarded – undo |
604
|
604
|
'createChatInviteLink' => ['chat_id'], |
605
|
605
|
'editChatInviteLink' => ['chat_id'], |
606
|
606
|
'revokeChatInviteLink' => ['chat_id'], |
607
|
|
- 'approveChatJoinRequest' => ['chat_id','user_id'], |
608
|
|
- 'declineChatJoinRequest' => ['chat_id','user_id'], |
|
607
|
+ 'approveChatJoinRequest' => ['chat_id', 'user_id'], |
|
608
|
+ 'declineChatJoinRequest' => ['chat_id', 'user_id'], |
609
|
609
|
'setChatPhoto' => ['chat_id'], |
610
|
610
|
'deleteChatPhoto' => ['chat_id'], |
611
|
611
|
'setChatTitle' => ['chat_id'], |
|
@@ -617,7 +617,7 @@ discard block |
|
|
block discarded – undo |
617
|
617
|
'getChat' => ['chat_id'], |
618
|
618
|
'getChatAdministrators' => ['chat_id'], |
619
|
619
|
'getChatMembersCount' => ['chat_id'], |
620
|
|
- 'getChatMember' => ['chat_id','user_id'], |
|
620
|
+ 'getChatMember' => ['chat_id', 'user_id'], |
621
|
621
|
'setChatStickerSet' => ['chat_id'], |
622
|
622
|
'deleteChatStickerSet' => ['chat_id'], |
623
|
623
|
'answerCallbackQuery' => ['callback_query_id'], |
|
@@ -628,12 +628,12 @@ discard block |
|
|
block discarded – undo |
628
|
628
|
'getChatMenuButton' => [], |
629
|
629
|
'setMyDefaultAdministratorRights' => [], |
630
|
630
|
'getMyDefaultAdministratorRights' => [], |
631
|
|
- 'editMessageText' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
632
|
|
- 'editMessageCaption' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
633
|
|
- 'editMessageMedia' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
634
|
|
- 'editMessageReplyMarkup' => ['inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
635
|
|
- 'stopPoll' => ['chat_id','message_id'], |
636
|
|
- 'deleteMessage' => ['chat_id','message_id'], |
|
631
|
+ 'editMessageText' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
632
|
+ 'editMessageCaption' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
633
|
+ 'editMessageMedia' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
634
|
+ 'editMessageReplyMarkup' => ['inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
635
|
+ 'stopPoll' => ['chat_id', 'message_id'], |
|
636
|
+ 'deleteMessage' => ['chat_id', 'message_id'], |
637
|
637
|
'sendSticker' => ['chat_id'], |
638
|
638
|
'getStickerSet' => [], |
639
|
639
|
'uploadStickerFile' => ['user_id'], |
|
@@ -649,8 +649,8 @@ discard block |
|
|
block discarded – undo |
649
|
649
|
'answerPreCheckoutQuery' => ['pre_checkout_query_id'], |
650
|
650
|
'setPassportDataErrors' => ['user_id'], |
651
|
651
|
'sendGame' => ['chat_id'], |
652
|
|
- 'setGameScore' => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']], |
653
|
|
- 'getGameHighScores' => ['user_id','inline_query'=>['inline_message_id'],'other'=>['chat_id','message_id']] |
|
652
|
+ 'setGameScore' => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']], |
|
653
|
+ 'getGameHighScores' => ['user_id', 'inline_query'=>['inline_message_id'], 'other'=>['chat_id', 'message_id']] |
654
|
654
|
]; |
655
|
655
|
|
656
|
656
|
private const METHODS_RETURN = [ |
|
@@ -702,29 +702,29 @@ discard block |
|
|
block discarded – undo |
702
|
702
|
'getGameHighScores' => ['BPT\types\gameHighScore'] |
703
|
703
|
]; |
704
|
704
|
|
705
|
|
- public static function __callStatic (string $name, array $arguments) { |
|
705
|
+ public static function __callStatic(string $name, array $arguments) { |
706
|
706
|
if ($action = self::methodAction($name)) { |
707
|
|
- self::keysName($action,$arguments); |
708
|
|
- self::readyFile($action,$arguments); |
709
|
|
- self::setDefaults($action,$arguments); |
|
707
|
+ self::keysName($action, $arguments); |
|
708
|
+ self::readyFile($action, $arguments); |
|
709
|
+ self::setDefaults($action, $arguments); |
710
|
710
|
if (isset($arguments['answer'])) { |
711
|
|
- return answer::init($action,$arguments); |
|
711
|
+ return answer::init($action, $arguments); |
712
|
712
|
} |
713
|
713
|
else { |
714
|
|
- $result = curl::init($action,$arguments); |
|
714
|
+ $result = curl::init($action, $arguments); |
715
|
715
|
if (is_object($result)) { |
716
|
|
- return self::processResponse($action,$result); |
|
716
|
+ return self::processResponse($action, $result); |
717
|
717
|
} |
718
|
718
|
return false; |
719
|
719
|
} |
720
|
720
|
} |
721
|
721
|
else { |
722
|
|
- logger::write("$name method is not supported",loggerTypes::ERROR); |
|
722
|
+ logger::write("$name method is not supported", loggerTypes::ERROR); |
723
|
723
|
throw new bptException('METHOD_NOT_FOUND'); |
724
|
724
|
} |
725
|
725
|
} |
726
|
726
|
|
727
|
|
- private static function keysName (string $name, array &$arguments): void { |
|
727
|
+ private static function keysName(string $name, array &$arguments): void { |
728
|
728
|
foreach ($arguments as $key => $argument) { |
729
|
729
|
if (is_numeric($key) && isset(self::METHODS_KEYS[$name][$key])) { |
730
|
730
|
$arguments[self::METHODS_KEYS[$name][$key]] = $argument; |
|
@@ -733,7 +733,7 @@ discard block |
|
|
block discarded – undo |
733
|
733
|
} |
734
|
734
|
} |
735
|
735
|
|
736
|
|
- private static function methodAction(string $name): string|false { |
|
736
|
+ private static function methodAction(string $name): string | false { |
737
|
737
|
return self::METHODS_ACTION[str_replace('_', '', strtolower($name))] ?? false; |
738
|
738
|
} |
739
|
739
|
|
|
@@ -754,11 +754,11 @@ discard block |
|
|
block discarded – undo |
754
|
754
|
} |
755
|
755
|
} |
756
|
756
|
|
757
|
|
- private static function methodFile(string $name): array|false { |
|
757
|
+ private static function methodFile(string $name): array | false { |
758
|
758
|
return self::METHODS_WITH_FILE[$name] ?? false; |
759
|
759
|
} |
760
|
760
|
|
761
|
|
- private static function methodReturn(string $name,stdClass $response) { |
|
761
|
+ private static function methodReturn(string $name, stdClass $response) { |
762
|
762
|
if (isset(self::METHODS_RETURN[$name])) { |
763
|
763
|
$return = self::METHODS_RETURN[$name]; |
764
|
764
|
if (is_array($return)) { |
|
@@ -781,13 +781,13 @@ discard block |
|
|
block discarded – undo |
781
|
781
|
$defaults = self::METHODS_EXTRA_DEFAULTS[$name]; |
782
|
782
|
foreach ($defaults as $key => $default) { |
783
|
783
|
if (is_numeric($key)) { |
784
|
|
- if (!isset($arguments[$default])){ |
|
784
|
+ if (!isset($arguments[$default])) { |
785
|
785
|
$arguments[$default] = self::catchFields($default); |
786
|
786
|
} |
787
|
787
|
} |
788
|
788
|
elseif (isset(BPT::$update->$key) || $key === 'other') { |
789
|
789
|
foreach ($default as $def) { |
790
|
|
- if (!isset($arguments[$def])){ |
|
790
|
+ if (!isset($arguments[$def])) { |
791
|
791
|
$arguments[$def] = self::catchFields($def); |
792
|
792
|
} |
793
|
793
|
} |
|
@@ -800,7 +800,7 @@ discard block |
|
|
block discarded – undo |
800
|
800
|
if ($response->ok) { |
801
|
801
|
self::$status = true; |
802
|
802
|
self::$pure_response = $response; |
803
|
|
- return self::methodReturn($name,$response); |
|
803
|
+ return self::methodReturn($name, $response); |
804
|
804
|
} |
805
|
805
|
else { |
806
|
806
|
self::$status = false; |
|
@@ -816,7 +816,7 @@ discard block |
|
|
block discarded – undo |
816
|
816
|
* |
817
|
817
|
* @return int|string|bool |
818
|
818
|
*/ |
819
|
|
- public static function catchFields (string $field): int|string|bool { |
|
819
|
+ public static function catchFields(string $field): int | string | bool { |
820
|
820
|
switch ($field) { |
821
|
821
|
case fields::CHAT_ID : |
822
|
822
|
case fields::FROM_CHAT_ID : |
|
@@ -952,7 +952,7 @@ discard block |
|
|
block discarded – undo |
952
|
952
|
default => false |
953
|
953
|
}; |
954
|
954
|
case fields::URL : |
955
|
|
- return 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; |
|
955
|
+ return 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; |
956
|
956
|
default: |
957
|
957
|
return false; |
958
|
958
|
} |