Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add resetCommandsPaths #1252

Merged
merged 2 commits into from
Dec 11, 2021
Merged

Conversation

wright-tw
Copy link
Contributor

@wright-tw wright-tw commented Oct 29, 2021

Solve the problem that the default command cannot be removed

? !
Type feature
BC Break yes
Fixed issues Solve the problem that the default command cannot be removed

Summary

Solve the problem that the default command cannot be removed
@noplanman
Copy link
Member

Hi @wright-tw, thanks for your contribution and sorry for the long wait!

What would make more sense in my opinion, is to have a setCommandsPath(string $path) and setCommandsPaths(array $paths) methods, which literally just overwrite the variable, using the existing methods to add the new ones.

Does that make sense to you?

@wright-tw
Copy link
Contributor Author

Hi @noplanman, thanks for your comment.

My purpose of adding a new reset method is
Don't want to use the old built-in commands in the suite

Examples of built-in commands:

src/Commands/AdminCommands/ChatsCommand.php
src/Commands/AdminCommands/CleanupCommand.php

@noplanman
Copy link
Member

@wright-tw Yes, that's how I understood it 👍

It makes more sense to add this feature more streamlined and to use the already existing methods.
I'll merge your PR and then adjust it.

Thanks for your contribution!

@noplanman noplanman merged commit d4964d4 into php-telegram-bot:develop Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants