@@ -64,11 +64,9 @@ discard block |
||
| 64 | 64 | foreach ($settings as $setting => $value) {
|
| 65 | 65 | try{
|
| 66 | 66 | self::$$setting = $value; |
| 67 | - } |
|
| 68 | - catch (TypeError){
|
|
| 67 | + } catch (TypeError){
|
|
| 69 | 68 | logger::write("$setting setting has wrong type , its set to default value",'warning');
|
| 70 | - } |
|
| 71 | - catch (Error){
|
|
| 69 | + } catch (Error){
|
|
| 72 | 70 | logger::write("$setting setting is not one of library settings",'warning');
|
| 73 | 71 | } |
| 74 | 72 | } |
@@ -79,12 +77,10 @@ discard block |
||
| 79 | 77 | self::secureFolder(); |
| 80 | 78 | self::db(); |
| 81 | 79 | self::$receiver !== receiver::GETUPDATES ? self::webhook() : self::getUpdates(); |
| 82 | - } |
|
| 83 | - else {
|
|
| 80 | + } else {
|
|
| 84 | 81 | logger::write('token format is not right, check it and try again','error');
|
| 85 | 82 | } |
| 86 | - } |
|
| 87 | - else {
|
|
| 83 | + } else {
|
|
| 88 | 84 | logger::write('You must specify token parameter in settings','error');
|
| 89 | 85 | } |
| 90 | 86 | } |
@@ -125,8 +121,7 @@ discard block |
||
| 125 | 121 | private static function getUpdates() {
|
| 126 | 122 | if (self::$handler) {
|
| 127 | 123 | getUpdates::init(); |
| 128 | - } |
|
| 129 | - else {
|
|
| 124 | + } else {
|
|
| 130 | 125 | logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler','error');
|
| 131 | 126 | } |
| 132 | 127 | } |
@@ -6,17 +6,17 @@ |
||
| 6 | 6 | * Different type of passport |
| 7 | 7 | */ |
| 8 | 8 | class passportTypes { |
| 9 | - public const PERSONAL_DETAILS = 'personal_details'; |
|
| 10 | - public const PASSPORT = 'passport'; |
|
| 11 | - public const DRIVER_LICENSE = 'driver_license'; |
|
| 12 | - public const IDENTITY_CARD = 'identity_card'; |
|
| 13 | - public const INTERNAL_PASSPORT = 'internal_passport'; |
|
| 14 | - public const ADDRESS = 'address'; |
|
| 15 | - public const UTILITY_BILL = 'utility_bill'; |
|
| 16 | - public const BANK_STATEMENT = 'bank_statement'; |
|
| 17 | - public const RENTAL_AGREEMENT = 'rental_agreement'; |
|
| 18 | - public const PASSPORT_REGISTRATION = 'passport_registration'; |
|
| 19 | - public const TEMPORARY_REGISTRATION = 'temporary_registration'; |
|
| 20 | - public const PHONE_NUMBER = 'phone_number'; |
|
| 21 | - public const EMAIL = 'email'; |
|
| 9 | + public const PERSONAL_DETAILS = 'personal_details'; |
|
| 10 | + public const PASSPORT = 'passport'; |
|
| 11 | + public const DRIVER_LICENSE = 'driver_license'; |
|
| 12 | + public const IDENTITY_CARD = 'identity_card'; |
|
| 13 | + public const INTERNAL_PASSPORT = 'internal_passport'; |
|
| 14 | + public const ADDRESS = 'address'; |
|
| 15 | + public const UTILITY_BILL = 'utility_bill'; |
|
| 16 | + public const BANK_STATEMENT = 'bank_statement'; |
|
| 17 | + public const RENTAL_AGREEMENT = 'rental_agreement'; |
|
| 18 | + public const PASSPORT_REGISTRATION = 'passport_registration'; |
|
| 19 | + public const TEMPORARY_REGISTRATION = 'temporary_registration'; |
|
| 20 | + public const PHONE_NUMBER = 'phone_number'; |
|
| 21 | + public const EMAIL = 'email'; |
|
| 22 | 22 | } |
@@ -6,18 +6,18 @@ |
||
| 6 | 6 | * Different type of updates |
| 7 | 7 | */ |
| 8 | 8 | class updateTypes { |
| 9 | - public const MESSAGE = 'message'; |
|
| 10 | - public const EDITED_MESSAGE = 'edited_message'; |
|
| 11 | - public const CHANNEL_POST = 'channel_post'; |
|
| 12 | - public const EDITED_CHANNEL_POST = 'edited_channel_post'; |
|
| 13 | - public const INLINE_QUERY = 'inline_query'; |
|
| 14 | - public const CHOSEN_INLINE_RESULT = 'chosen_inline_result'; |
|
| 15 | - public const CALLBACK_QUERY = 'callback_query'; |
|
| 16 | - public const SHIPPING_QUERY = 'shipping_query'; |
|
| 17 | - public const PRE_CHECKOUT_QUERY = 'pre_checkout_query'; |
|
| 18 | - public const POLL = 'poll'; |
|
| 19 | - public const POLL_ANSWER = 'poll_answer'; |
|
| 20 | - public const MY_CHAT_MEMBER = 'my_chat_member'; |
|
| 21 | - public const CHAT_MEMBER = 'chat_member'; |
|
| 22 | - public const CHAT_JOIN_REQUEST = 'chat_join_request'; |
|
| 9 | + public const MESSAGE = 'message'; |
|
| 10 | + public const EDITED_MESSAGE = 'edited_message'; |
|
| 11 | + public const CHANNEL_POST = 'channel_post'; |
|
| 12 | + public const EDITED_CHANNEL_POST = 'edited_channel_post'; |
|
| 13 | + public const INLINE_QUERY = 'inline_query'; |
|
| 14 | + public const CHOSEN_INLINE_RESULT = 'chosen_inline_result'; |
|
| 15 | + public const CALLBACK_QUERY = 'callback_query'; |
|
| 16 | + public const SHIPPING_QUERY = 'shipping_query'; |
|
| 17 | + public const PRE_CHECKOUT_QUERY = 'pre_checkout_query'; |
|
| 18 | + public const POLL = 'poll'; |
|
| 19 | + public const POLL_ANSWER = 'poll_answer'; |
|
| 20 | + public const MY_CHAT_MEMBER = 'my_chat_member'; |
|
| 21 | + public const CHAT_MEMBER = 'chat_member'; |
|
| 22 | + public const CHAT_JOIN_REQUEST = 'chat_join_request'; |
|
| 23 | 23 | } |
@@ -6,15 +6,15 @@ |
||
| 6 | 6 | * Type of the chat |
| 7 | 7 | */ |
| 8 | 8 | class chatType { |
| 9 | - /** Chat type is personal */ |
|
| 10 | - public const PRIVATE = 'private'; |
|
| 9 | + /** Chat type is personal */ |
|
| 10 | + public const PRIVATE = 'private'; |
|
| 11 | 11 | |
| 12 | - /** Chat type is normal group */ |
|
| 13 | - public const GROUP = 'group'; |
|
| 12 | + /** Chat type is normal group */ |
|
| 13 | + public const GROUP = 'group'; |
|
| 14 | 14 | |
| 15 | - /** Chat type is supergroup */ |
|
| 16 | - public const SUPERGROUP = 'supergroup'; |
|
| 15 | + /** Chat type is supergroup */ |
|
| 16 | + public const SUPERGROUP = 'supergroup'; |
|
| 17 | 17 | |
| 18 | - /** Chat type is channel */ |
|
| 19 | - public const CHANNEL = 'channel'; |
|
| 18 | + /** Chat type is channel */ |
|
| 19 | + public const CHANNEL = 'channel'; |
|
| 20 | 20 | } |
@@ -7,33 +7,33 @@ |
||
| 7 | 7 | * set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its status) |
| 8 | 8 | */ |
| 9 | 9 | class chatActions { |
| 10 | - /** Sets chat status as Typing */ |
|
| 11 | - public const TYPING = 'typing'; |
|
| 10 | + /** Sets chat status as Typing */ |
|
| 11 | + public const TYPING = 'typing'; |
|
| 12 | 12 | |
| 13 | - /** Sets chat status as Sending Photo */ |
|
| 14 | - public const UPLOAD_PHOTO = 'upload_photo'; |
|
| 13 | + /** Sets chat status as Sending Photo */ |
|
| 14 | + public const UPLOAD_PHOTO = 'upload_photo'; |
|
| 15 | 15 | |
| 16 | - /** Sets chat status as Recording Video */ |
|
| 17 | - public const RECORD_VIDEO = 'record_video'; |
|
| 16 | + /** Sets chat status as Recording Video */ |
|
| 17 | + public const RECORD_VIDEO = 'record_video'; |
|
| 18 | 18 | |
| 19 | - /** Sets chat status as Sending Video */ |
|
| 20 | - public const UPLOAD_VIDEO = 'upload_video'; |
|
| 19 | + /** Sets chat status as Sending Video */ |
|
| 20 | + public const UPLOAD_VIDEO = 'upload_video'; |
|
| 21 | 21 | |
| 22 | - /** Sets chat status as Recording Audio */ |
|
| 23 | - public const RECORD_AUDIO = 'record_audio'; |
|
| 22 | + /** Sets chat status as Recording Audio */ |
|
| 23 | + public const RECORD_AUDIO = 'record_audio'; |
|
| 24 | 24 | |
| 25 | - /** Sets chat status as Sending Audio */ |
|
| 26 | - public const UPLOAD_AUDIO = 'upload_audio'; |
|
| 25 | + /** Sets chat status as Sending Audio */ |
|
| 26 | + public const UPLOAD_AUDIO = 'upload_audio'; |
|
| 27 | 27 | |
| 28 | - /** Sets chat status as Sending Document */ |
|
| 29 | - public const UPLOAD_DOCUMENT = 'upload_document'; |
|
| 28 | + /** Sets chat status as Sending Document */ |
|
| 29 | + public const UPLOAD_DOCUMENT = 'upload_document'; |
|
| 30 | 30 | |
| 31 | - /** Sets chat status as Choosing Geo */ |
|
| 32 | - public const FIND_LOCATION = 'find_location'; |
|
| 31 | + /** Sets chat status as Choosing Geo */ |
|
| 32 | + public const FIND_LOCATION = 'find_location'; |
|
| 33 | 33 | |
| 34 | - /** Sets chat status as Recording Video Note */ |
|
| 35 | - public const RECORD_VIDEO_NOTE = 'record_video_note'; |
|
| 34 | + /** Sets chat status as Recording Video Note */ |
|
| 35 | + public const RECORD_VIDEO_NOTE = 'record_video_note'; |
|
| 36 | 36 | |
| 37 | - /** Sets chat status as Sending Video Note */ |
|
| 38 | - public const UPLOAD_VIDEO_NOTE = 'upload_video_note'; |
|
| 37 | + /** Sets chat status as Sending Video Note */ |
|
| 38 | + public const UPLOAD_VIDEO_NOTE = 'upload_video_note'; |
|
| 39 | 39 | } |
@@ -6,6 +6,6 @@ |
||
| 6 | 6 | * Different type of polls |
| 7 | 7 | */ |
| 8 | 8 | class pollType { |
| 9 | - public const REGULAR = 'regular'; |
|
| 10 | - public const QUIZ = 'quiz'; |
|
| 9 | + public const REGULAR = 'regular'; |
|
| 10 | + public const QUIZ = 'quiz'; |
|
| 11 | 11 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * Different types of parse modes |
| 7 | 7 | */ |
| 8 | 8 | class parseMode { |
| 9 | - public const MARKDOWNV2 = 'MarkdownV2'; |
|
| 10 | - public const MARKDOWN = 'Markdown'; |
|
| 11 | - public const HTML = 'HTML'; |
|
| 9 | + public const MARKDOWNV2 = 'MarkdownV2'; |
|
| 10 | + public const MARKDOWN = 'Markdown'; |
|
| 11 | + public const HTML = 'HTML'; |
|
| 12 | 12 | } |
@@ -6,6 +6,6 @@ |
||
| 6 | 6 | * Different types of update receiver |
| 7 | 7 | */ |
| 8 | 8 | class receiver { |
| 9 | - public const GETUPDATES = 'getupdates'; |
|
| 10 | - public const WEBHOOK = 'webhook'; |
|
| 9 | + public const GETUPDATES = 'getupdates'; |
|
| 10 | + public const WEBHOOK = 'webhook'; |
|
| 11 | 11 | } |
@@ -6,19 +6,19 @@ |
||
| 6 | 6 | * types of message entity |
| 7 | 7 | */ |
| 8 | 8 | class messageEntityTypes { |
| 9 | - public const MENTION = 'mention'; |
|
| 10 | - public const HASHTAG = 'hashtag'; |
|
| 11 | - public const CASHTAG = 'cashtag'; |
|
| 12 | - public const BOT_COMMAND = 'bot_command'; |
|
| 13 | - public const URL = 'url'; |
|
| 14 | - public const EMAIL = 'email'; |
|
| 15 | - public const PHONE_NUMBER = 'phone_number'; |
|
| 16 | - public const BOLD = 'bold'; |
|
| 17 | - public const ITALIC = 'italic'; |
|
| 18 | - public const UNDERLINE = 'underline'; |
|
| 19 | - public const STRIKETHROUGH = 'strikethrough'; |
|
| 20 | - public const CODE = 'code'; |
|
| 21 | - public const PRE = 'pre'; |
|
| 22 | - public const TEXT_LINK = 'text_link'; |
|
| 23 | - public const TEXT_MENTION = 'text_mention'; |
|
| 9 | + public const MENTION = 'mention'; |
|
| 10 | + public const HASHTAG = 'hashtag'; |
|
| 11 | + public const CASHTAG = 'cashtag'; |
|
| 12 | + public const BOT_COMMAND = 'bot_command'; |
|
| 13 | + public const URL = 'url'; |
|
| 14 | + public const EMAIL = 'email'; |
|
| 15 | + public const PHONE_NUMBER = 'phone_number'; |
|
| 16 | + public const BOLD = 'bold'; |
|
| 17 | + public const ITALIC = 'italic'; |
|
| 18 | + public const UNDERLINE = 'underline'; |
|
| 19 | + public const STRIKETHROUGH = 'strikethrough'; |
|
| 20 | + public const CODE = 'code'; |
|
| 21 | + public const PRE = 'pre'; |
|
| 22 | + public const TEXT_LINK = 'text_link'; |
|
| 23 | + public const TEXT_MENTION = 'text_mention'; |
|
| 24 | 24 | } |