mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-15 14:16:49 +00:00
fix(commands): remove examples from command discovery
This commit is contained in:
1 parent
b5c7427520
commit
a211b7f8b7
22 files changed
+47
-154
No files matched your search
@@ -47,22 +47,6 @@ func TestValidateCommand_RejectsInvalidPresentationMetadata(t *testing.T) {
|
||||
name: "multiline parameters",
|
||||
command: Command{Name: "ok", Visibility: VisibilityPublic, Description: "d", Parameters: "<a>\n<b>", Handler: okHandler},
|
||||
},
|
||||
{
|
||||
name: "multiline example",
|
||||
command: Command{Name: "ok", Visibility: VisibilityPublic, Description: "d", Example: "/ok one\n/ok two", Handler: okHandler},
|
||||
},
|
||||
{
|
||||
name: "example invokes another command",
|
||||
command: Command{Name: "ok", Visibility: VisibilityPublic, Description: "d", Example: "/other", Handler: okHandler},
|
||||
},
|
||||
{
|
||||
name: "example without parameters",
|
||||
command: Command{Name: "ok", Visibility: VisibilityPublic, Description: "d", Example: "/ok", Handler: okHandler},
|
||||
},
|
||||
{
|
||||
name: "parameters without example",
|
||||
command: Command{Name: "ok", Visibility: VisibilityPublic, Description: "d", Parameters: "<value>", Handler: okHandler},
|
||||
},
|
||||
{
|
||||
name: "native description too long",
|
||||
command: Command{Name: "ok", Visibility: VisibilityPublic, Description: strings.Repeat("x", 257), Handler: okHandler},
|
||||
@@ -86,13 +70,12 @@ func TestValidateCommand_AcceptsLegalNames(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateCommand_AcceptsMatchedParametersAndExample(t *testing.T) {
|
||||
func TestValidateCommand_AcceptsParameters(t *testing.T) {
|
||||
command := Command{
|
||||
Name: "ok",
|
||||
Visibility: VisibilityPublic,
|
||||
Description: "Do it",
|
||||
Parameters: "<value>",
|
||||
Example: "/ok demo",
|
||||
Handler: okHandler,
|
||||
}
|
||||
if err := validateCommand(command); err != nil {
|
||||
|
||||
Reference in new issue
Block a user