Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F627514
GenericCommand.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
GenericCommand.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
\
Request
;
/**
* Generic command
*/
class
GenericCommand
extends
SystemCommand
{
/**#@+
* {@inheritdoc}
*/
protected
$name
=
'Generic'
;
protected
$description
=
'Handles generic commands or is executed by default when a command is not found'
;
protected
$version
=
'1.0.1'
;
/**#@-*/
/**
* {@inheritdoc}
*/
public
function
execute
(
)
{
$message
=
$this
->
getMessage
(
)
;
//You can use $command as param
$command
=
$message
->
getCommand
(
)
;
$chat_id
=
$message
->
getChat
(
)
->
getId
(
)
;
$data
=
[
'chat_id'
=>
$chat_id
,
'text'
=>
'Command /'
.
$command
.
' not found.. :('
,
]
;
return
Request
::
sendMessage
(
$data
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 15, 2:13 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
133935
Default Alt Text
GenericCommand.php (1 KB)
Attached To
Mode
R123 php-telegram-bot
Attached
Detach File
Event Timeline