Commit b143572a authored by Jack'lul's avatar Jack'lul

Merge branch 'develop' into fix

parents c499c1c5 db51d06d
...@@ -8,6 +8,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ...@@ -8,6 +8,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- New entities, methods, update types and inline keyboard button for Payments (Bot API 3.0). - New entities, methods, update types and inline keyboard button for Payments (Bot API 3.0).
### Changed ### Changed
- [:exclamation:][unreleased-correct-printerror] Corrected `ServerResponse->printError` method to print by default and return by setting `$return` parameter. - [:exclamation:][unreleased-correct-printerror] Corrected `ServerResponse->printError` method to print by default and return by setting `$return` parameter.
- Ensure command names are handled as lower case.
### Deprecated ### Deprecated
### Removed ### Removed
### Fixed ### Fixed
......
...@@ -20,7 +20,7 @@ class ChannelchatcreatedCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class ChannelchatcreatedCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Channelchatcreated'; protected $name = 'channelchatcreated';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class ChannelpostCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class ChannelpostCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Channelpost'; protected $name = 'channelpost';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class DeletechatphotoCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class DeletechatphotoCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Deletechatphoto'; protected $name = 'deletechatphoto';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class EditedchannelpostCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class EditedchannelpostCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Editedchannelpost'; protected $name = 'editedchannelpost';
/** /**
* @var string * @var string
......
...@@ -21,7 +21,7 @@ class GenericCommand extends SystemCommand ...@@ -21,7 +21,7 @@ class GenericCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Generic'; protected $name = 'generic';
/** /**
* @var string * @var string
......
...@@ -22,7 +22,7 @@ class GenericmessageCommand extends SystemCommand ...@@ -22,7 +22,7 @@ class GenericmessageCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Genericmessage'; protected $name = 'genericmessage';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class GroupchatcreatedCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class GroupchatcreatedCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Groupchatcreated'; protected $name = 'groupchatcreated';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class LeftchatmemberCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class LeftchatmemberCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Leftchatmember'; protected $name = 'leftchatmember';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class MigratefromchatidCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class MigratefromchatidCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Migratefromchatid'; protected $name = 'migratefromchatid';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class MigratetochatidCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class MigratetochatidCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Migratetochatid'; protected $name = 'migratetochatid';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class NewchatmembersCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class NewchatmembersCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Newchatmembers'; protected $name = 'newchatmembers';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class NewchatphotoCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class NewchatphotoCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Newchatphoto'; protected $name = 'newchatphoto';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class NewchattitleCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class NewchattitleCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Newchattitle'; protected $name = 'newchattitle';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class PinnedmessageCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class PinnedmessageCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Pinnedmessage'; protected $name = 'pinnedmessage';
/** /**
* @var string * @var string
......
...@@ -20,7 +20,7 @@ class SupergroupchatcreatedCommand extends SystemCommand ...@@ -20,7 +20,7 @@ class SupergroupchatcreatedCommand extends SystemCommand
/** /**
* @var string * @var string
*/ */
protected $name = 'Supergroupchatcreated'; protected $name = 'supergroupchatcreated';
/** /**
* @var string * @var string
......
...@@ -470,16 +470,17 @@ class Telegram ...@@ -470,16 +470,17 @@ class Telegram
*/ */
public function executeCommand($command) public function executeCommand($command)
{ {
$command = strtolower($command);
$command_obj = $this->getCommandObject($command); $command_obj = $this->getCommandObject($command);
if (!$command_obj || !$command_obj->isEnabled()) { if (!$command_obj || !$command_obj->isEnabled()) {
//Failsafe in case the Generic command can't be found //Failsafe in case the Generic command can't be found
if ($command === 'Generic') { if ($command === 'generic') {
throw new TelegramException('Generic command missing!'); throw new TelegramException('Generic command missing!');
} }
//Handle a generic command or non existing one //Handle a generic command or non existing one
$this->last_command_response = $this->executeCommand('Generic'); $this->last_command_response = $this->executeCommand('generic');
} else { } else {
//Botan.io integration, make sure only the actual command user executed is reported //Botan.io integration, make sure only the actual command user executed is reported
if ($this->botan_enabled) { if ($this->botan_enabled) {
......
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