Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F625889
GenericmessageCommand.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
GenericmessageCommand.php
View Options
<?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
\
SystemCommands
;
use
Longman
\
TelegramBot
\
Commands
\
SystemCommand
;
use
Longman
\
TelegramBot
\
Conversation
;
use
Longman
\
TelegramBot
\
Request
;
/**
* Generic message command
*/
class
GenericmessageCommand
extends
SystemCommand
{
/**
* @var string
*/
protected
$name
=
'genericmessage'
;
/**
* @var string
*/
protected
$description
=
'Handle generic message'
;
/**
* @var string
*/
protected
$version
=
'1.1.0'
;
/**
* @var bool
*/
protected
$need_mysql
=
true
;
/**
* Execution if MySQL is required but not available
*
* @return \Longman\TelegramBot\Entities\ServerResponse
*/
public
function
executeNoDb
(
)
{
//Do nothing
return
Request
::
emptyResponse
(
)
;
}
/**
* Execute command
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public
function
execute
(
)
{
//If a conversation is busy, execute the conversation command after handling the message
$conversation
=
new
Conversation
(
$this
->
getMessage
(
)
->
getFrom
(
)
->
getId
(
)
,
$this
->
getMessage
(
)
->
getChat
(
)
->
getId
(
)
)
;
//Fetch conversation command if it exists and execute it
if
(
$conversation
->
exists
(
)
&&
(
$command
=
$conversation
->
getCommand
(
)
)
)
{
return
$this
->
telegram
->
executeCommand
(
$command
)
;
}
return
Request
::
emptyResponse
(
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 15, 12:03 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
152000
Default Alt Text
GenericmessageCommand.php (1 KB)
Attached To
Mode
R123 php-telegram-bot
Attached
Detach File
Event Timeline