Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
e09613bc
Unverified
Commit
e09613bc
authored
Apr 22, 2018
by
Avtandil Kikabidze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix code style
parent
6b4a1cc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
DebugCommand.php
src/Commands/AdminCommands/DebugCommand.php
+8
-2
Entity.php
src/Entities/Entity.php
+2
-1
No files found.
src/Commands/AdminCommands/DebugCommand.php
View file @
e09613bc
...
...
@@ -103,13 +103,19 @@ class DebugCommand extends AdminCommand
if
(
empty
(
$request
->
json
()
->
all
()))
{
$debug_info
[]
=
$webhook_info_title
.
' `Using getUpdates method, not Webhook.`'
;
}
else
{
$webhook_info_result
=
json_decode
(
Client
::
getWebhookInfo
(),
true
)[
'result'
];
/** @var \Longman\TelegramBot\Http\Response $response */
$response
=
Client
::
getWebhookInfo
();
/** @var \Longman\TelegramBot\Entities\WebhookInfo $result */
$result
=
$response
->
getResult
();
$webhook_info_result
=
$result
->
getRawData
();
// Add a human-readable error date string if necessary.
if
(
isset
(
$webhook_info_result
[
'last_error_date'
]))
{
$webhook_info_result
[
'last_error_date_string'
]
=
date
(
'Y-m-d H:i:s'
,
$webhook_info_result
[
'last_error_date'
]);
}
$webhook_info_result_str
=
json_encode
(
$webhook_info_result
,
JSON_PRETTY_PRINT
|
JSON_UNESCAPED_SLASHES
);
$webhook_info_result_str
=
json_encode
(
$webhook_info_result
,
JSON_PRETTY_PRINT
|
JSON_UNESCAPED_SLASHES
|
JSON_UNESCAPED_UNICODE
);
$debug_info
[]
=
$webhook_info_title
;
$debug_info
[]
=
sprintf
(
'```'
.
PHP_EOL
.
'%s```'
,
...
...
src/Entities/Entity.php
View file @
e09613bc
...
...
@@ -38,7 +38,7 @@ abstract class Entity
*/
public
function
__construct
(
$data
,
$bot_username
=
''
)
{
//Make sure we're not raw_data inception-ing
//
Make sure we're not raw_data inception-ing
if
(
array_key_exists
(
'raw_data'
,
$data
))
{
if
(
$data
[
'raw_data'
]
===
null
)
{
unset
(
$data
[
'raw_data'
]);
...
...
@@ -48,6 +48,7 @@ abstract class Entity
}
$data
[
'bot_username'
]
=
$bot_username
;
$this
->
assignMemberVariables
(
$data
);
$this
->
validate
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment