Closed Doncode closed 8 years ago
The command have to follow the namespace of the library but if you need you can create you own father command with your namespace and inherit from it. Why you need a custom namespace?
HelpCommand
is part of the package (and part of namespace Longman\TelegramBot\Commands\UserCommands
)
MyCustomCommand
even if it inherited from abstract Longman\TelegramBot\Commands\UserCommands\UserCommand
is not part of your package and requires its own (my own) namespace.
The logical separation is reasonable because it avoid misunderstanding: If I have problems and bugs in MyCustomCommand
I will go to my MyCustomCommands
folder instead of trying to find that class in vendor directory.
Note that namespace Longman\TelegramBot\Commands\UserCommands
is similar to folder structure. So I guess using of this namespace even for examples would be wrong.
Can i create command with custom namespace