Fixes for the /echo command (#4843)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
1f67c91fce
Коммит
2da388d297
@@ -40,6 +40,10 @@ func (me *EchoProvider) GetCommand(c *Context) *model.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (me *EchoProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
func (me *EchoProvider) DoCommand(c *Context, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||||
|
if len(message) == 0 {
|
||||||
|
return &model.CommandResponse{Text: c.T("api.command_echo.message.app_error"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
|
||||||
|
}
|
||||||
|
|
||||||
maxThreads := 100
|
maxThreads := 100
|
||||||
|
|
||||||
delay := 0
|
delay := 0
|
||||||
|
|||||||
@@ -17,8 +17,11 @@ func TestEchoCommand(t *testing.T) {
|
|||||||
|
|
||||||
echoTestString := "/echo test"
|
echoTestString := "/echo test"
|
||||||
|
|
||||||
r1 := Client.Must(Client.Command(channel1.Id, echoTestString)).Data.(*model.CommandResponse)
|
if r1 := Client.Must(Client.Command(channel1.Id, echoTestString)).Data.(*model.CommandResponse); r1 == nil {
|
||||||
if r1 == nil {
|
t.Fatal("Echo command failed to execute")
|
||||||
|
}
|
||||||
|
|
||||||
|
if r1 := Client.Must(Client.Command(channel1.Id, "/echo ")).Data.(*model.CommandResponse); r1 == nil {
|
||||||
t.Fatal("Echo command failed to execute")
|
t.Fatal("Echo command failed to execute")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -491,6 +491,10 @@
|
|||||||
"id": "api.command_echo.create.app_error",
|
"id": "api.command_echo.create.app_error",
|
||||||
"translation": "Unable to create /echo post, err=%v"
|
"translation": "Unable to create /echo post, err=%v"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "api.command_echo.message.app_error",
|
||||||
|
"translation": "A message must be provided with the /echo command."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "api.command_echo.delay.app_error",
|
"id": "api.command_echo.delay.app_error",
|
||||||
"translation": "Delays must be under 10000 seconds"
|
"translation": "Delays must be under 10000 seconds"
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user