我在Slack中创建了自己的Timer应用程序 . 我已经为此集成了Incoming Webhook . 我的示例斜杠命令是“/ in” . 因此,当HTTP帖子没问题时,它会向用户返回一条消息,其中包含“您的名字已经计时”,但它也会返回响应但您可以看到 .

See Screenshot

public function slack(Request $request)
    {
        //open connection
        $ch = curl_init();
        $payload = '{"text" : "'. $request->user_name .' has time in"}';
        $hook = 'https://hooks.slack.com/services/some-string-here';
        //set the url, number of POST vars, POST data
        curl_setopt($ch,CURLOPT_URL, $hook);
        curl_setopt($ch,CURLOPT_POSTFIELDS, $payload);

        //execute post
        $result = curl_exec($ch);

        //close connection
        curl_close($ch);

        $response = 'You are now timed in.';

        return $response;

    }

现在我的问题是如何删除“ok”这个词 .

我正在使用Laravel / PHP .