{“消息”:“无法发送空消息”,“代码”:50006} gitlab

时间:2020-05-26 18:58:17

标签: gitlab webhooks

我想在Gitlab和Discord之间通过weebhook集成一个bot,因此我已经配置了该bot,复制了他的url并将其放入gitlab weebhook配置输入中,并将其设置为将推送更新发送到Discord服务器。

通过真实的推力测试,我(身体)有了

Request headers:

Content-Type: application/json
X-Gitlab-Event: Push Hook

并作为回应

Response headers:

Date: Tue, 26 May 2020 18:46:48 GMT
Content-Type: application/json
Content-Length: 58
Connection: close
Set-Cookie: __cfduid=d374998c2f84e3e20b75bbdec88fb63d91590518808; expires=Thu, 25-Jun-20 18:46:48 GMT; path=/; domain=.discordapp.com; HttpOnly; SameSite=Lax, __cfruid=418f7199379a53d23012d37b15f2ac5a3aac36b6-1590518808; path=/; domain=.discordapp.com; HttpOnly; Secure; SameSite=None
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Ratelimit-Bucket: 3cd1f278bd0ecaf11e0d2391374c011d
X-Ratelimit-Limit: 5
X-Ratelimit-Remaining: 4
X-Ratelimit-Reset: 1590518811
X-Ratelimit-Reset-After: 2
X-Envoy-Upstream-Service-Time: 12
Via: 1.1 google
Cf-Cache-Status: DYNAMIC
Cf-Request-Id: 02f3e816a1000004823d920200000001
Expect-Ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
Cf-Ray: 5999a9376a790482-CDG

但出现错误:

Response body:

{"message": "Cannot send an empty message", "code": 50006}

或者也是

Hook executed successfully but returned HTTP 400 {"message": "Cannot send an empty message", "code": 50006}

感谢帮助

1 个答案:

答案 0 :(得分:0)

您需要对“ Discord通知”使用“集成”功能,而不是常规的Webhook。

请参见documentation here