-
Notifications
You must be signed in to change notification settings - Fork 103
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
Command "command" not found. #356
Comments
GitMate.io thinks the contributor most likely able to help you is @meetmangukiya. |
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
It's generelly advisable to use |
Then you can usually post-process arguments but the command is still directed to the right function 👍 |
In my opinion, existing code is short and simple, using |
I think this problems can be solved by not using |
But when it doesn't match your regex again, we get this message another time ;) |
And |
Which message are you referring to? |
|
Yeah! that's what I almost fixed here, I am just getting some queue empty error here. Can you check my PR #406 |
That's why you should rather use |
Okay, the commit completely fixes the error, I just have some optional args error with |
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
See gitter chat at https://gitter.im/coala/corobo?at=5a2e4b2fc65707ba2b3995ef Brief of discussion:
Advantages:
|
Why is that a problem? That step would happen in the command function^^ |
@Makman2 If we use only |
@arg_botcmd(...)
def mycommand(..., arg1):
import re
m = re.match(myregex, arg1)
if m is None:
print('Error! arg1 is invalid!')
else:
# proceed
pass Doesn't appear to me as a limitation^^
You definitely have to be more precise^^ |
Ok, I have agreed that way is good, what can we do with commands having aliases? |
We could copy function declarations and redirect to the main function in the worst case, but I don't really like it: # alias
@arg_botcmd(...)
def a(...):
return assign(...)
@arg_botcmd(...)
def assign(...):
# normal implementation |
I hope there's another way^^ |
We will be having problem with help message as well, and I too don't like above method |
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
Give proper usage of command when a command is used without args. Fixes coala#356
We are regularly seeing
Command "foo" not found.
when the person correctly didcorobo foo ...
.They used the wrong arguments, but the error returned is confusing.
It should tell them they gave the foo command the wrong arguments, and possible even force feed them the help in a DM to help them use the bot properly.
What is happening is that corobo is not doing partial matches on only the command, but the error is saying that it cant match the command.
lmgtfy
was the command in normal parlance.foo
is a parameter, or argument, etc.The error message is wrong, and unhelpful.
The text was updated successfully, but these errors were encountered: