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
1968e938
Commit
1968e938
authored
Feb 18, 2016
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructure command files.
parent
7147479e
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
184 additions
and
146 deletions
+184
-146
AbstractCommand.php
src/Commands/AbstractCommand.php
+21
-26
AbstractAdminCommand.php
src/Commands/Admin/AbstractAdminCommand.php
+29
-0
ChatsCommand.php
src/Commands/Admin/ChatsCommand.php
+3
-23
SendtoallCommand.php
src/Commands/Admin/SendtoallCommand.php
+10
-28
SendtochannelCommand.php
src/Commands/Admin/SendtochannelCommand.php
+3
-4
AbstractSystemCommand.php
src/Commands/System/AbstractSystemCommand.php
+29
-0
ChannelchatcreatedCommand.php
src/Commands/System/ChannelchatcreatedCommand.php
+5
-5
ChoseninlineresultCommand.php
src/Commands/System/ChoseninlineresultCommand.php
+5
-5
DeletechatphotoCommand.php
src/Commands/System/DeletechatphotoCommand.php
+3
-3
GenericCommand.php
src/Commands/System/GenericCommand.php
+3
-3
GenericmessageCommand.php
src/Commands/System/GenericmessageCommand.php
+3
-3
GroupchatcreatedCommand.php
src/Commands/System/GroupchatcreatedCommand.php
+3
-3
InlinequeryCommand.php
src/Commands/System/InlinequeryCommand.php
+3
-3
LeftchatparticipantCommand.php
src/Commands/System/LeftchatparticipantCommand.php
+3
-3
NewchatparticipantCommand.php
src/Commands/System/NewchatparticipantCommand.php
+3
-3
NewchattitleCommand.php
src/Commands/System/NewchattitleCommand.php
+3
-3
SupergroupchatcreatedCommand.php
src/Commands/System/SupergroupchatcreatedCommand.php
+3
-3
AbstractUserCommand.php
src/Commands/User/AbstractUserCommand.php
+29
-0
DateCommand.php
src/Commands/User/DateCommand.php
+3
-3
EchoCommand.php
src/Commands/User/EchoCommand.php
+3
-4
HelpCommand.php
src/Commands/User/HelpCommand.php
+5
-9
SlapCommand.php
src/Commands/User/SlapCommand.php
+3
-3
StartCommand.php
src/Commands/User/StartCommand.php
+3
-3
WeatherCommand.php
src/Commands/User/WeatherCommand.php
+3
-3
WhoamiCommand.php
src/Commands/User/WhoamiCommand.php
+3
-3
No files found.
src/Command.php
→
src/Command
s/AbstractCommand
.php
View file @
1968e938
...
...
@@ -8,8 +8,9 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot
;
namespace
Longman\TelegramBot
\Commands
;
use
Longman\TelegramBot\Telegram
;
use
Longman\TelegramBot\Entities\Chat
;
use
Longman\TelegramBot\Entities\Update
;
use
Longman\TelegramBot\Entities\User
;
...
...
@@ -82,13 +83,6 @@ abstract class Command
*/
protected
$enabled
=
true
;
/**
* If this command is public
*
* @var boolean
*/
protected
$public
=
false
;
/**
* If this command needs mysql
*
...
...
@@ -120,10 +114,12 @@ abstract class Command
* @param Entities\Update $update
* @return Command
*/
public
function
setUpdate
(
Update
$update
)
public
function
setUpdate
(
Update
$update
=
null
)
{
$this
->
update
=
$update
;
$this
->
message
=
$this
->
update
->
getMessage
();
if
(
!
empty
(
$update
))
{
$this
->
update
=
$update
;
$this
->
message
=
$this
->
update
->
getMessage
();
}
return
$this
;
}
...
...
@@ -134,9 +130,7 @@ abstract class Command
*/
public
function
preExecute
()
{
if
(
!
$this
->
need_mysql
|
$this
->
need_mysql
&
$this
->
telegram
->
isDbEnabled
()
&
DB
::
isDbConnected
()
)
{
if
(
!
$this
->
need_mysql
||
(
$this
->
telegram
->
isDbEnabled
()
&&
DB
::
isDbConnected
()))
{
return
$this
->
execute
();
}
return
$this
->
executeNoDB
();
...
...
@@ -148,14 +142,25 @@ abstract class Command
abstract
public
function
execute
();
/**
* This methods is executed if $need_mysql is true
* but DB connection for some reason is not avaiable
* Execution if MySQL is required but not available
*
* @return boolean
*/
public
function
executeNoDB
()
{
//Preparing message
$message
=
$this
->
getMessage
();
$chat_id
=
$message
->
getChat
()
->
getId
();
$data
=
[
'chat_id'
=>
$chat_id
,
'text'
=>
'Sorry no database connection, unable to execute "'
.
$this
->
name
.
'" command.'
,
];
return
Request
::
sendMessage
(
$data
)
->
isOk
();
}
/**
* Get update object
*
...
...
@@ -267,14 +272,4 @@ abstract class Command
{
return
$this
->
enabled
;
}
/**
* Check if command is public
*
* @return boolean
*/
public
function
isPublic
()
{
return
$this
->
public
;
}
}
src/Commands/Admin/AbstractAdminCommand.php
0 → 100644
View file @
1968e938
<?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\Telegram
;
/**
* Abstract Admin Command Class
*/
abstract
class
AdminCommand
extends
Command
{
/**
* Constructor
*
* @param Telegram $telegram
*/
public
function
__construct
(
Telegram
$telegram
)
{
parent
::
__construct
(
$telegram
);
}
}
src/Admin/ChatsCommand.php
→
src/
Commands/
Admin/ChatsCommand.php
View file @
1968e938
...
...
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\AdminCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\AdminCommand
;
use
Longman\TelegramBot\DB
;
use
Longman\TelegramBot\Entities\Chat
;
use
Longman\TelegramBot\Request
;
...
...
@@ -18,7 +18,7 @@ use Longman\TelegramBot\Request;
/**
* Admin "/chats" command
*/
class
ChatsCommand
extends
Command
class
ChatsCommand
extends
Admin
Command
{
/**#@+
* {@inheritdoc}
...
...
@@ -27,29 +27,9 @@ class ChatsCommand extends Command
protected
$description
=
'List all chats stored by the bot'
;
protected
$usage
=
'/chats'
;
protected
$version
=
'1.0.1'
;
protected
$public
=
true
;
protected
$need_mysql
=
false
;
/**#@-*/
/**
* Execution if MySQL is required but not available
*
* @return boolean
*/
public
function
executeNoDB
()
{
//Preparing message
$message
=
$this
->
getMessage
();
$chat_id
=
$message
->
getChat
()
->
getId
();
$data
=
[
'chat_id'
=>
$chat_id
,
'text'
=>
'Sorry no database connection, unable to execute "'
.
$this
->
name
.
'" command.'
,
];
return
Request
::
sendMessage
(
$data
)
->
isOk
();
}
/**
* Execute command
*
...
...
src/Admin/SendtoallCommand.php
→
src/
Commands/
Admin/SendtoallCommand.php
View file @
1968e938
...
...
@@ -8,46 +8,26 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\AdminCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\AdminCommand
;
use
Longman\TelegramBot\Request
;
/**
* Admin "/sendtoall" command
*/
class
SendtoallCommand
extends
Command
class
SendtoallCommand
extends
Admin
Command
{
/**#@+
* {@inheritdoc}
*/
protected
$name
=
'sendtoall'
;
protected
$description
=
'Send the message to all the user\'s bot'
;
protected
$usage
=
'/sendall <message to send>'
;
protected
$usage
=
'/send
to
all <message to send>'
;
protected
$version
=
'1.2.1'
;
protected
$public
=
true
;
protected
$need_mysql
=
true
;
/**#@-*/
/**
* Execution if MySQL is required but not available
*
* @return boolean
*/
public
function
executeNoDB
()
{
//Preparing message
$message
=
$this
->
getMessage
();
$chat_id
=
$message
->
getChat
()
->
getId
();
$data
=
[
'chat_id'
=>
$chat_id
,
'text'
=>
'Sorry no database connection, unable to execute "'
.
$this
->
name
.
'" command.'
,
];
return
Request
::
sendMessage
(
$data
)
->
isOk
();
}
/**
* Execute command
*
...
...
@@ -60,9 +40,10 @@ class SendtoallCommand extends Command
$message
=
$this
->
getMessage
();
$chat_id
=
$message
->
getChat
()
->
getId
();
$text
=
$message
->
getText
(
true
);
if
(
empty
(
$text
))
{
$text
=
'Write the message to send: /sendall <message>'
;
$text
=
'Write the message to send: /send
to
all <message>'
;
}
else
{
$results
=
Request
::
sendToActiveChats
(
'sendMessage'
,
//callback function to execute (see Request.php methods)
...
...
@@ -103,9 +84,10 @@ class SendtoallCommand extends Command
$text
.=
$tot
.
') '
.
$status
.
' '
.
$type
.
' '
.
$name
.
"
\n
"
;
}
$text
.=
'Delivered: '
.
(
$tot
-
$fail
)
.
'/'
.
$tot
.
"
\n
"
;
}
if
(
$tot
===
0
)
{
$text
=
'No users or chats found..'
;
if
(
$tot
===
0
)
{
$text
=
'No users or chats found..'
;
}
}
$data
=
[
...
...
src/Admin/SendtochannelCommand.php
→
src/
Commands/
Admin/SendtochannelCommand.php
View file @
1968e938
...
...
@@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\AdminCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\AdminCommand
;
use
Longman\TelegramBot\Request
;
/**
* Admin "/sendtochannel" command
*/
class
SendtochannelCommand
extends
Command
class
SendtochannelCommand
extends
Admin
Command
{
/**#@+
* {@inheritdoc}
...
...
@@ -25,7 +25,6 @@ class SendtochannelCommand extends Command
protected
$description
=
'Send message to a channel'
;
protected
$usage
=
'/sendchannel <message to send>'
;
protected
$version
=
'0.1.1'
;
protected
$public
=
true
;
protected
$need_mysql
=
false
;
/**#@-*/
...
...
src/Commands/System/AbstractSystemCommand.php
0 → 100644
View file @
1968e938
<?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\Telegram
;
/**
* Abstract System Command Class
*/
abstract
class
SystemCommand
extends
Command
{
/**
* Constructor
*
* @param Telegram $telegram
*/
public
function
__construct
(
Telegram
$telegram
)
{
parent
::
__construct
(
$telegram
);
}
}
src/Commands/ChannelchatcreatedCommand.php
→
src/Commands/
System/
ChannelchatcreatedCommand.php
View file @
1968e938
...
...
@@ -8,21 +8,21 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
/**
* Channel chat created command
*/
class
ChannelchatcreatedCommand
extends
Command
class
ChannelchatcreatedCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
*/
protected
$name
=
'Channelchatcreated'
;
protected
$name
=
'Channelchatcreated'
;
protected
$description
=
'Channel chat created'
;
protected
$version
=
'1.0.1'
;
protected
$version
=
'1.0.1'
;
/**#@-*/
/**
...
...
src/Commands/ChoseninlineresultCommand.php
→
src/Commands/
System/
ChoseninlineresultCommand.php
View file @
1968e938
...
...
@@ -8,21 +8,21 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
/**
* Chosen inline result command
*/
class
ChoseninlineresultCommand
extends
Command
class
ChoseninlineresultCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
*/
protected
$name
=
'choseninlineresult'
;
protected
$name
=
'choseninlineresult'
;
protected
$description
=
'Chosen result query'
;
protected
$version
=
'1.0.1'
;
protected
$version
=
'1.0.1'
;
/**#@-*/
/**
...
...
src/Commands/DeletechatphotoCommand.php
→
src/Commands/
System/
DeletechatphotoCommand.php
View file @
1968e938
...
...
@@ -8,14 +8,14 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
/**
* Delete chat photo command
*/
class
DeletechatphotoCommand
extends
Command
class
DeletechatphotoCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/GenericCommand.php
→
src/Commands/
System/
GenericCommand.php
View file @
1968e938
...
...
@@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
use
Longman\TelegramBot\Request
;
/**
* Generic command
*/
class
GenericCommand
extends
Command
class
GenericCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/GenericmessageCommand.php
→
src/Commands/
System/
GenericmessageCommand.php
View file @
1968e938
...
...
@@ -8,14 +8,14 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
/**
* Generic message command
*/
class
GenericmessageCommand
extends
Command
class
GenericmessageCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/GroupchatcreatedCommand.php
→
src/Commands/
System/
GroupchatcreatedCommand.php
View file @
1968e938
...
...
@@ -8,14 +8,14 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
/**
* Group chat created command
*/
class
GroupchatcreatedCommand
extends
Command
class
GroupchatcreatedCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/InlinequeryCommand.php
→
src/Commands/
System/
InlinequeryCommand.php
View file @
1968e938
...
...
@@ -8,16 +8,16 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
use
Longman\TelegramBot\Entities\InlineQueryResultArticle
;
use
Longman\TelegramBot\Request
;
/**
* Inline query command
*/
class
InlinequeryCommand
extends
Command
class
InlinequeryCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/LeftchatparticipantCommand.php
→
src/Commands/
System/
LeftchatparticipantCommand.php
View file @
1968e938
...
...
@@ -8,14 +8,14 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
/**
* Left chat participant command
*/
class
LeftchatparticipantCommand
extends
Command
class
LeftchatparticipantCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/NewchatparticipantCommand.php
→
src/Commands/
System/
NewchatparticipantCommand.php
View file @
1968e938
...
...
@@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
use
Longman\TelegramBot\Request
;
/**
* New chat participant command
*/
class
NewchatparticipantCommand
extends
Command
class
NewchatparticipantCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/NewchattitleCommand.php
→
src/Commands/
System/
NewchattitleCommand.php
View file @
1968e938
...
...
@@ -8,14 +8,14 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
/**
* New chat title command
*/
class
NewchattitleCommand
extends
Command
class
NewchattitleCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/SupergroupchatcreatedCommand.php
→
src/Commands/S
ystem/S
upergroupchatcreatedCommand.php
View file @
1968e938
...
...
@@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\SystemCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\SystemCommand
;
use
Longman\TelegramBot\Request
;
/**
* Super group chat created command
*/
class
SupergroupchatcreatedCommand
extends
Command
class
SupergroupchatcreatedCommand
extends
System
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/User/AbstractUserCommand.php
0 → 100644
View file @
1968e938
<?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\Telegram
;
/**
* Abstract User Command Class
*/
abstract
class
UserCommand
extends
Command
{
/**
* Constructor
*
* @param Telegram $telegram
*/
public
function
__construct
(
Telegram
$telegram
)
{
parent
::
__construct
(
$telegram
);
}
}
src/Commands/DateCommand.php
→
src/Commands/
User/
DateCommand.php
View file @
1968e938
...
...
@@ -8,16 +8,16 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\UserCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\UserCommand
;
use
Longman\TelegramBot\Exception\TelegramException
;
use
Longman\TelegramBot\Request
;
/**
* User "/date" command
*/
class
DateCommand
extends
Command
class
DateCommand
extends
User
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/EchoCommand.php
→
src/Commands/
User/
EchoCommand.php
View file @
1968e938
...
...
@@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\UserCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\UserCommand
;
use
Longman\TelegramBot\Request
;
/**
* User "/echo" command
*/
class
EchoCommand
extends
Command
class
EchoCommand
extends
User
Command
{
/**#@+
* {@inheritdoc}
...
...
@@ -25,7 +25,6 @@ class EchoCommand extends Command
protected
$description
=
'Show text'
;
protected
$usage
=
'/echo <text>'
;
protected
$version
=
'1.0.1'
;
protected
$public
=
true
;
/**#@-*/
/**
...
...
src/Commands/HelpCommand.php
→
src/Commands/
User/
HelpCommand.php
View file @
1968e938
...
...
@@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\UserCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\UserCommand
;
use
Longman\TelegramBot\Request
;
/**
* User "/help" command
*/
class
HelpCommand
extends
Command
class
HelpCommand
extends
User
Command
{
/**#@+
* {@inheritdoc}
...
...
@@ -25,7 +25,6 @@ class HelpCommand extends Command
protected
$description
=
'Show bot commands help'
;
protected
$usage
=
'/help or /help <command>'
;
protected
$version
=
'1.0.1'
;
protected
$public
=
true
;
/**#@-*/
/**
...
...
@@ -36,8 +35,8 @@ class HelpCommand extends Command
public
function
execute
()
{
$message
=
$this
->
getMessage
();
$chat_id
=
$message
->
getChat
()
->
getId
();
$message_id
=
$message
->
getMessageId
();
$text
=
$message
->
getText
(
true
);
...
...
@@ -51,9 +50,6 @@ class HelpCommand extends Command
if
(
!
$command
->
isEnabled
())
{
continue
;
}
if
(
!
$command
->
isPublic
())
{
continue
;
}
$msg
.=
'/'
.
$command
->
getName
()
.
' - '
.
$command
->
getDescription
()
.
"
\n
"
;
}
...
...
@@ -64,7 +60,7 @@ class HelpCommand extends Command
$text
=
str_replace
(
'/'
,
''
,
$text
);
if
(
isset
(
$commands
[
$text
]))
{
$command
=
$commands
[
$text
];
if
(
!
$command
->
isEnabled
()
||
!
$command
->
isPublic
()
)
{
if
(
!
$command
->
isEnabled
())
{
$msg
=
'Command '
.
$text
.
' not found'
;
}
else
{
$msg
=
'Command: '
.
$command
->
getName
()
.
' v'
.
$command
->
getVersion
()
.
"
\n
"
;
...
...
src/Commands/SlapCommand.php
→
src/Commands/
User/
SlapCommand.php
View file @
1968e938
...
...
@@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\UserCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\UserCommand
;
use
Longman\TelegramBot\Request
;
/**
* User "/slap" command
*/
class
SlapCommand
extends
Command
class
SlapCommand
extends
User
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/StartCommand.php
→
src/Commands/
User/
StartCommand.php
View file @
1968e938
...
...
@@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\UserCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\UserCommand
;
use
Longman\TelegramBot\Request
;
/**
* Start command
*/
class
StartCommand
extends
Command
class
StartCommand
extends
User
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/WeatherCommand.php
→
src/Commands/
User/
WeatherCommand.php
View file @
1968e938
...
...
@@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\UserCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\UserCommand
;
use
Longman\TelegramBot\Request
;
/**
* User "/weather" command
*/
class
WeatherCommand
extends
Command
class
WeatherCommand
extends
User
Command
{
/**#@+
* {@inheritdoc}
...
...
src/Commands/WhoamiCommand.php
→
src/Commands/
User/
WhoamiCommand.php
View file @
1968e938
...
...
@@ -10,16 +10,16 @@
* Written by Marco Boretto <marco.bore@gmail.com>
*/
namespace
Longman\TelegramBot\Commands
;
namespace
Longman\TelegramBot\Commands
\UserCommands
;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Command
s\UserCommand
;
use
Longman\TelegramBot\Entities\File
;
use
Longman\TelegramBot\Request
;
/**
* User "/whoami" command
*/
class
WhoamiCommand
extends
Command
class
WhoamiCommand
extends
User
Command
{
/**#@+
* {@inheritdoc}
...
...
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