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
c04686e9
Unverified
Commit
c04686e9
authored
Apr 22, 2018
by
Avtandil Kikabidze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename the method and use request class from container
parent
e3f13a1c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
ChatsCommand.php
src/Commands/AdminCommands/ChatsCommand.php
+1
-1
DebugCommand.php
src/Commands/AdminCommands/DebugCommand.php
+7
-2
No files found.
src/Commands/AdminCommands/ChatsCommand.php
View file @
c04686e9
...
@@ -83,7 +83,7 @@ class ChatsCommand extends AdminCommand
...
@@ -83,7 +83,7 @@ class ChatsCommand extends AdminCommand
$chat
=
new
Chat
(
$result
);
$chat
=
new
Chat
(
$result
);
$whois
=
$chat
->
getId
();
$whois
=
$chat
->
getId
();
if
(
$this
->
telegram
->
get
CommandObject
(
'whois'
))
{
if
(
$this
->
telegram
->
create
CommandObject
(
'whois'
))
{
// We can't use '-' in command because part of it will become unclickable
// We can't use '-' in command because part of it will become unclickable
$whois
=
'/whois'
.
str_replace
(
'-'
,
'g'
,
$chat
->
getId
());
$whois
=
'/whois'
.
str_replace
(
'-'
,
'g'
,
$chat
->
getId
());
}
}
...
...
src/Commands/AdminCommands/DebugCommand.php
View file @
c04686e9
...
@@ -10,9 +10,11 @@
...
@@ -10,9 +10,11 @@
namespace
Longman\TelegramBot\Commands\AdminCommands
;
namespace
Longman\TelegramBot\Commands\AdminCommands
;
use
Exception
;
use
Longman\TelegramBot\Commands\AdminCommand
;
use
Longman\TelegramBot\Commands\AdminCommand
;
use
Longman\TelegramBot\DB
;
use
Longman\TelegramBot\DB
;
use
Longman\TelegramBot\Http\Client
;
use
Longman\TelegramBot\Http\Client
;
use
Longman\TelegramBot\Http\Request
;
/**
/**
* Admin "/debug" command
* Admin "/debug" command
...
@@ -94,8 +96,11 @@ class DebugCommand extends AdminCommand
...
@@ -94,8 +96,11 @@ class DebugCommand extends AdminCommand
$webhook_info_title
=
'*Webhook Info:*'
;
$webhook_info_title
=
'*Webhook Info:*'
;
try
{
try
{
/** @var \Longman\TelegramBot\Http\Request $request */
$request
=
$this
->
getTelegram
()
->
getContainer
()
->
make
(
Request
::
class
);
// Check if we're actually using the Webhook method.
// Check if we're actually using the Webhook method.
if
(
Client
::
getInput
()
===
''
)
{
if
(
empty
(
$request
->
json
()
->
all
())
)
{
$debug_info
[]
=
$webhook_info_title
.
' `Using getUpdates method, not Webhook.`'
;
$debug_info
[]
=
$webhook_info_title
.
' `Using getUpdates method, not Webhook.`'
;
}
else
{
}
else
{
$webhook_info_result
=
json_decode
(
Client
::
getWebhookInfo
(),
true
)[
'result'
];
$webhook_info_result
=
json_decode
(
Client
::
getWebhookInfo
(),
true
)[
'result'
];
...
@@ -111,7 +116,7 @@ class DebugCommand extends AdminCommand
...
@@ -111,7 +116,7 @@ class DebugCommand extends AdminCommand
$webhook_info_result_str
$webhook_info_result_str
);
);
}
}
}
catch
(
\
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
$debug_info
[]
=
$webhook_info_title
.
sprintf
(
' `Failed to get webhook info! (%s)`'
,
$e
->
getMessage
());
$debug_info
[]
=
$webhook_info_title
.
sprintf
(
' `Failed to get webhook info! (%s)`'
,
$e
->
getMessage
());
}
}
...
...
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