Commit 1968e938 authored by Armando Lüscher's avatar Armando Lüscher

Restructure command files.

parent 7147479e
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
* file that was distributed with this source code. * 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\Chat;
use Longman\TelegramBot\Entities\Update; use Longman\TelegramBot\Entities\Update;
use Longman\TelegramBot\Entities\User; use Longman\TelegramBot\Entities\User;
...@@ -82,13 +83,6 @@ abstract class Command ...@@ -82,13 +83,6 @@ abstract class Command
*/ */
protected $enabled = true; protected $enabled = true;
/**
* If this command is public
*
* @var boolean
*/
protected $public = false;
/** /**
* If this command needs mysql * If this command needs mysql
* *
...@@ -120,10 +114,12 @@ abstract class Command ...@@ -120,10 +114,12 @@ abstract class Command
* @param Entities\Update $update * @param Entities\Update $update
* @return Command * @return Command
*/ */
public function setUpdate(Update $update) public function setUpdate(Update $update = null)
{ {
$this->update = $update; if (!empty($update)) {
$this->message = $this->update->getMessage(); $this->update = $update;
$this->message = $this->update->getMessage();
}
return $this; return $this;
} }
...@@ -134,9 +130,7 @@ abstract class Command ...@@ -134,9 +130,7 @@ abstract class Command
*/ */
public function preExecute() public function preExecute()
{ {
if (!$this->need_mysql | if (!$this->need_mysql || ($this->telegram->isDbEnabled() && DB::isDbConnected())) {
$this->need_mysql & $this->telegram->isDbEnabled() & DB::isDbConnected()
) {
return $this->execute(); return $this->execute();
} }
return $this->executeNoDB(); return $this->executeNoDB();
...@@ -148,14 +142,25 @@ abstract class Command ...@@ -148,14 +142,25 @@ abstract class Command
abstract public function execute(); abstract public function execute();
/** /**
* This methods is executed if $need_mysql is true * Execution if MySQL is required but not available
* but DB connection for some reason is not avaiable *
* @return boolean
*/ */
public function executeNoDB() 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 * Get update object
* *
...@@ -267,14 +272,4 @@ abstract class Command ...@@ -267,14 +272,4 @@ abstract class Command
{ {
return $this->enabled; return $this->enabled;
} }
/**
* Check if command is public
*
* @return boolean
*/
public function isPublic()
{
return $this->public;
}
} }
<?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);
}
}
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\AdminCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\AdminCommand;
use Longman\TelegramBot\DB; use Longman\TelegramBot\DB;
use Longman\TelegramBot\Entities\Chat; use Longman\TelegramBot\Entities\Chat;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
...@@ -18,7 +18,7 @@ use Longman\TelegramBot\Request; ...@@ -18,7 +18,7 @@ use Longman\TelegramBot\Request;
/** /**
* Admin "/chats" command * Admin "/chats" command
*/ */
class ChatsCommand extends Command class ChatsCommand extends AdminCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
...@@ -27,29 +27,9 @@ class ChatsCommand extends Command ...@@ -27,29 +27,9 @@ class ChatsCommand extends Command
protected $description = 'List all chats stored by the bot'; protected $description = 'List all chats stored by the bot';
protected $usage = '/chats'; protected $usage = '/chats';
protected $version = '1.0.1'; protected $version = '1.0.1';
protected $public = true;
protected $need_mysql = false; 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 * Execute command
* *
......
...@@ -8,46 +8,26 @@ ...@@ -8,46 +8,26 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\AdminCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\AdminCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* Admin "/sendtoall" command * Admin "/sendtoall" command
*/ */
class SendtoallCommand extends Command class SendtoallCommand extends AdminCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
*/ */
protected $name = 'sendtoall'; protected $name = 'sendtoall';
protected $description = 'Send the message to all the user\'s bot'; protected $description = 'Send the message to all the user\'s bot';
protected $usage = '/sendall <message to send>'; protected $usage = '/sendtoall <message to send>';
protected $version = '1.2.1'; protected $version = '1.2.1';
protected $public = true;
protected $need_mysql = 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 * Execute command
* *
...@@ -60,9 +40,10 @@ class SendtoallCommand extends Command ...@@ -60,9 +40,10 @@ class SendtoallCommand extends Command
$message = $this->getMessage(); $message = $this->getMessage();
$chat_id = $message->getChat()->getId(); $chat_id = $message->getChat()->getId();
$text = $message->getText(true);
if (empty($text)) { if (empty($text)) {
$text = 'Write the message to send: /sendall <message>'; $text = 'Write the message to send: /sendtoall <message>';
} else { } else {
$results = Request::sendToActiveChats( $results = Request::sendToActiveChats(
'sendMessage', //callback function to execute (see Request.php methods) 'sendMessage', //callback function to execute (see Request.php methods)
...@@ -103,9 +84,10 @@ class SendtoallCommand extends Command ...@@ -103,9 +84,10 @@ class SendtoallCommand extends Command
$text .= $tot . ') ' . $status . ' ' . $type . ' ' . $name . "\n"; $text .= $tot . ') ' . $status . ' ' . $type . ' ' . $name . "\n";
} }
$text .= 'Delivered: ' . ($tot - $fail) . '/' . $tot . "\n"; $text .= 'Delivered: ' . ($tot - $fail) . '/' . $tot . "\n";
}
if ($tot === 0) { if ($tot === 0) {
$text = 'No users or chats found..'; $text = 'No users or chats found..';
}
} }
$data = [ $data = [
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\AdminCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\AdminCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* Admin "/sendtochannel" command * Admin "/sendtochannel" command
*/ */
class SendtochannelCommand extends Command class SendtochannelCommand extends AdminCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
...@@ -25,7 +25,6 @@ class SendtochannelCommand extends Command ...@@ -25,7 +25,6 @@ class SendtochannelCommand extends Command
protected $description = 'Send message to a channel'; protected $description = 'Send message to a channel';
protected $usage = '/sendchannel <message to send>'; protected $usage = '/sendchannel <message to send>';
protected $version = '0.1.1'; protected $version = '0.1.1';
protected $public = true;
protected $need_mysql = false; protected $need_mysql = false;
/**#@-*/ /**#@-*/
......
<?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);
}
}
...@@ -8,21 +8,21 @@ ...@@ -8,21 +8,21 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
/** /**
* Channel chat created command * Channel chat created command
*/ */
class ChannelchatcreatedCommand extends Command class ChannelchatcreatedCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
*/ */
protected $name = 'Channelchatcreated'; protected $name = 'Channelchatcreated';
protected $description = 'Channel chat created'; protected $description = 'Channel chat created';
protected $version = '1.0.1'; protected $version = '1.0.1';
/**#@-*/ /**#@-*/
/** /**
......
...@@ -8,21 +8,21 @@ ...@@ -8,21 +8,21 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
/** /**
* Chosen inline result command * Chosen inline result command
*/ */
class ChoseninlineresultCommand extends Command class ChoseninlineresultCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
*/ */
protected $name = 'choseninlineresult'; protected $name = 'choseninlineresult';
protected $description = 'Chosen result query'; protected $description = 'Chosen result query';
protected $version = '1.0.1'; protected $version = '1.0.1';
/**#@-*/ /**#@-*/
/** /**
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
/** /**
* Delete chat photo command * Delete chat photo command
*/ */
class DeletechatphotoCommand extends Command class DeletechatphotoCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* Generic command * Generic command
*/ */
class GenericCommand extends Command class GenericCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
/** /**
* Generic message command * Generic message command
*/ */
class GenericmessageCommand extends Command class GenericmessageCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
/** /**
* Group chat created command * Group chat created command
*/ */
class GroupchatcreatedCommand extends Command class GroupchatcreatedCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Entities\InlineQueryResultArticle; use Longman\TelegramBot\Entities\InlineQueryResultArticle;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* Inline query command * Inline query command
*/ */
class InlinequeryCommand extends Command class InlinequeryCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
/** /**
* Left chat participant command * Left chat participant command
*/ */
class LeftchatparticipantCommand extends Command class LeftchatparticipantCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* New chat participant command * New chat participant command
*/ */
class NewchatparticipantCommand extends Command class NewchatparticipantCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
/** /**
* New chat title command * New chat title command
*/ */
class NewchattitleCommand extends Command class NewchattitleCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\SystemCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* Super group chat created command * Super group chat created command
*/ */
class SupergroupchatcreatedCommand extends Command class SupergroupchatcreatedCommand extends SystemCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
<?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);
}
}
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\UserCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Exception\TelegramException; use Longman\TelegramBot\Exception\TelegramException;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* User "/date" command * User "/date" command
*/ */
class DateCommand extends Command class DateCommand extends UserCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\UserCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* User "/echo" command * User "/echo" command
*/ */
class EchoCommand extends Command class EchoCommand extends UserCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
...@@ -25,7 +25,6 @@ class EchoCommand extends Command ...@@ -25,7 +25,6 @@ class EchoCommand extends Command
protected $description = 'Show text'; protected $description = 'Show text';
protected $usage = '/echo <text>'; protected $usage = '/echo <text>';
protected $version = '1.0.1'; protected $version = '1.0.1';
protected $public = true;
/**#@-*/ /**#@-*/
/** /**
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\UserCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* User "/help" command * User "/help" command
*/ */
class HelpCommand extends Command class HelpCommand extends UserCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
...@@ -25,7 +25,6 @@ class HelpCommand extends Command ...@@ -25,7 +25,6 @@ class HelpCommand extends Command
protected $description = 'Show bot commands help'; protected $description = 'Show bot commands help';
protected $usage = '/help or /help <command>'; protected $usage = '/help or /help <command>';
protected $version = '1.0.1'; protected $version = '1.0.1';
protected $public = true;
/**#@-*/ /**#@-*/
/** /**
...@@ -36,8 +35,8 @@ class HelpCommand extends Command ...@@ -36,8 +35,8 @@ class HelpCommand extends Command
public function execute() public function execute()
{ {
$message = $this->getMessage(); $message = $this->getMessage();
$chat_id = $message->getChat()->getId(); $chat_id = $message->getChat()->getId();
$message_id = $message->getMessageId(); $message_id = $message->getMessageId();
$text = $message->getText(true); $text = $message->getText(true);
...@@ -51,9 +50,6 @@ class HelpCommand extends Command ...@@ -51,9 +50,6 @@ class HelpCommand extends Command
if (!$command->isEnabled()) { if (!$command->isEnabled()) {
continue; continue;
} }
if (!$command->isPublic()) {
continue;
}
$msg .= '/' . $command->getName() . ' - ' . $command->getDescription() . "\n"; $msg .= '/' . $command->getName() . ' - ' . $command->getDescription() . "\n";
} }
...@@ -64,7 +60,7 @@ class HelpCommand extends Command ...@@ -64,7 +60,7 @@ class HelpCommand extends Command
$text = str_replace('/', '', $text); $text = str_replace('/', '', $text);
if (isset($commands[$text])) { if (isset($commands[$text])) {
$command = $commands[$text]; $command = $commands[$text];
if (!$command->isEnabled() || !$command->isPublic()) { if (!$command->isEnabled()) {
$msg = 'Command ' . $text . ' not found'; $msg = 'Command ' . $text . ' not found';
} else { } else {
$msg = 'Command: ' . $command->getName() . ' v' . $command->getVersion() . "\n"; $msg = 'Command: ' . $command->getName() . ' v' . $command->getVersion() . "\n";
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\UserCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* User "/slap" command * User "/slap" command
*/ */
class SlapCommand extends Command class SlapCommand extends UserCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\UserCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* Start command * Start command
*/ */
class StartCommand extends Command class StartCommand extends UserCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\UserCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* User "/weather" command * User "/weather" command
*/ */
class WeatherCommand extends Command class WeatherCommand extends UserCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
...@@ -10,16 +10,16 @@ ...@@ -10,16 +10,16 @@
* Written by Marco Boretto <marco.bore@gmail.com> * Written by Marco Boretto <marco.bore@gmail.com>
*/ */
namespace Longman\TelegramBot\Commands; namespace Longman\TelegramBot\Commands\UserCommands;
use Longman\TelegramBot\Command; use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Entities\File; use Longman\TelegramBot\Entities\File;
use Longman\TelegramBot\Request; use Longman\TelegramBot\Request;
/** /**
* User "/whoami" command * User "/whoami" command
*/ */
class WhoamiCommand extends Command class WhoamiCommand extends UserCommand
{ {
/**#@+ /**#@+
* {@inheritdoc} * {@inheritdoc}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment