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
820130b0
Commit
820130b0
authored
Jan 23, 2016
by
MBoretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chosen result works
parent
febec1b4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
ChoseninlineresultCommand.php
src/Commands/ChoseninlineresultCommand.php
+39
-0
Update.php
src/Entities/Update.php
+10
-0
No files found.
src/Commands/ChoseninlineresultCommand.php
0 → 100644
View file @
820130b0
<?php
/*
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
use
Longman\TelegramBot\Request
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Entities\Update
;
use
Longman\TelegramBot\Entities\InlineQueryResultArticle
;
use
Longman\TelegramBot\Entities\Entity
;
class
ChoseninlineresultCommand
extends
Command
{
protected
$name
=
'choseninlineresult'
;
protected
$description
=
'Chosen result query'
;
protected
$usage
=
''
;
protected
$version
=
'1.0.0'
;
protected
$enabled
=
true
;
protected
$public
=
false
;
public
function
execute
()
{
$update
=
$this
->
getUpdate
();
$inline_query
=
$update
->
getChosenInlineResult
();
$query
=
$inline_query
->
getQuery
();
//information about chosen result are returned
//Do nothing
return
1
;
}
}
src/Entities/Update.php
View file @
820130b0
...
@@ -73,4 +73,14 @@ class Update extends Entity
...
@@ -73,4 +73,14 @@ class Update extends Entity
{
{
return
$this
->
update_type
;
return
$this
->
update_type
;
}
}
public
function
getUpdateContent
()
{
if
(
$this
->
update_type
==
'message'
)
{
return
$this
->
getMessage
();
}
elseif
(
$this
->
update_type
==
'inline_query'
)
{
return
$this
->
getInlineQuery
();
}
elseif
(
$this
->
update_type
==
'chosen_inline_result'
)
{
return
$this
->
getChosenInlineResult
();
}
}
}
}
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