diff --git a/src/Telegram.php b/src/Telegram.php index a36cab9a..c5bad748 100644 --- a/src/Telegram.php +++ b/src/Telegram.php @@ -854,6 +854,24 @@ public function addCommandsPath(string $path, bool $before = true): Telegram return $this; } + /** + * change Command folder path (other command folder about to invalid) + * + * @param string $path Custom commands path + * @author Wright + * @return Telegram + */ + public function resetCommandsPaths(string $path): Telegram + { + if (!is_dir($path)) { + TelegramLog::error('reset commands path "' . $path . '" does not exist.'); + } elseif (!in_array($path, $this->commands_paths, true)) { + $this->commands_paths = [$path]; + } + + return $this; + } + /** * Add multiple custom commands paths *