Rename and prevent redefinition of path constants.

parent c3c94238
......@@ -6,6 +6,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
## [Unreleased]
### Added
### Changed
- [:exclamation:][unreleased-bc-rename-constants] Rename and ensure no redefinition of constants: `BASE_PATH` -> `TB_BASE_PATH`, `BASE_COMMANDS_PATH` -> `TB_BASE_COMMANDS_PATH`.
### Deprecated
### Removed
### Fixed
......
......@@ -10,8 +10,8 @@
namespace Longman\TelegramBot;
defined('BASE_PATH') or define('BASE_PATH', __DIR__);
define('BASE_COMMANDS_PATH', BASE_PATH . '/Commands');
defined('TB_BASE_PATH') || define('TB_BASE_PATH', __DIR__);
defined('TB_BASE_COMMANDS_PATH') || define('TB_BASE_COMMANDS_PATH', TB_BASE_PATH . '/Commands');
use Exception;
use Longman\TelegramBot\Commands\Command;
......@@ -177,7 +177,7 @@ class Telegram
}
//Add default system commands path
$this->addCommandsPath(BASE_COMMANDS_PATH . '/SystemCommands');
$this->addCommandsPath(TB_BASE_COMMANDS_PATH . '/SystemCommands');
Request::initialize($this);
}
......@@ -461,7 +461,7 @@ class Telegram
//Load admin commands
if ($this->isAdmin()) {
$this->addCommandsPath(BASE_COMMANDS_PATH . '/AdminCommands', false);
$this->addCommandsPath(TB_BASE_COMMANDS_PATH . '/AdminCommands', false);
}
$type = $message->getType();
......
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