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
86678198
Commit
86678198
authored
Feb 28, 2016
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix generic message command to use new conversation methods.
parent
00bcf786
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
GenericmessageCommand.php
src/Commands/SystemCommands/GenericmessageCommand.php
+9
-8
No files found.
src/Commands/SystemCommands/GenericmessageCommand.php
View file @
86678198
...
...
@@ -24,7 +24,7 @@ class GenericmessageCommand extends SystemCommand
*/
protected
$name
=
'Genericmessage'
;
protected
$description
=
'Handle generic message'
;
protected
$version
=
'1.0.
1
'
;
protected
$version
=
'1.0.
2
'
;
protected
$need_mysql
=
true
;
/**#@-*/
...
...
@@ -46,15 +46,16 @@ class GenericmessageCommand extends SystemCommand
*/
public
function
execute
()
{
//
System command, fetch command to execute if conversation exist
$
message
=
$this
->
getMessage
();
$chat_id
=
$message
->
getChat
()
->
getId
();
$user_id
=
$message
->
getFrom
()
->
getId
();
//Fetch Conversation if exist
$command
=
(
new
Conversation
(
$user_id
,
$chat_id
))
->
getConversationCommand
();
if
(
!
is_null
(
$command
))
{
//
If a conversation is busy, execute the conversation command after handling the message
$
conversation
=
new
Conversation
(
$this
->
getMessage
()
->
getChat
()
->
getId
(),
$this
->
getMessage
()
->
getFrom
()
->
getId
()
);
//Fetch conversation command if it exists and execute it
if
(
$conversation
->
exists
()
&&
(
$command
=
$conversation
->
getCommand
()
))
{
return
$this
->
telegram
->
executeCommand
(
$command
,
$this
->
update
);
}
return
Request
::
emptyResponse
();
}
}
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