[GH-ISSUE #767] [Bug] mattermost机器人必须登录才可发送而mattermost是禁止机器人登录的 #520

Closed
opened 2026-03-03 01:03:59 +03:00 by kerem · 1 comment
Owner

Originally created by @AEGEGE on GitHub (Jun 5, 2025).
Original GitHub issue: https://github.com/certimate-go/certimate/issues/767

软件版本 / Release Version

0.3.16

缺陷描述 / Description

mattermost通知,目前必须要验证用户登录才可使用,实际上mattermost用户可以创建自己的bot,bot是不可进行登陆的,仅需要api key及频道id即可实现消息发送。官方接口例子是这样的:

curl -i -X POST -H 'Content-Type: application/json' -d '{"channel_id":"<channel-id>", "message":"This is a message from a bot", "props":{"attachments": [{"pretext": "Look some text","text": "This is text"}]}}' -H 'Authorization: Bearer <bot-access-token>' <mattermost-url>/api/v4/posts

复现步骤 / Steps to reproduce

无法直接使用bot,仅能通过真是账户验证登录才可使用

日志 / Logs

mattermost api error: unexpected status code: 401, resp: {"id":"api.user.login.bot_login_forbidden.app_error","message":"Bot login is forbidden.","detailed_error":"","request_id":"rursbe98ytb1mgcwrrgrhof54r","status_code":401}

其他 / Miscellaneous

No response

贡献 / Contribution

  • 我乐意为此贡献代码! / I am interested in contributing to this issue!
Originally created by @AEGEGE on GitHub (Jun 5, 2025). Original GitHub issue: https://github.com/certimate-go/certimate/issues/767 ### 软件版本 / Release Version 0.3.16 ### 缺陷描述 / Description mattermost通知,目前必须要验证用户登录才可使用,实际上mattermost用户可以创建自己的bot,bot是不可进行登陆的,仅需要api key及频道id即可实现消息发送。官方接口例子是这样的: ``` curl -i -X POST -H 'Content-Type: application/json' -d '{"channel_id":"<channel-id>", "message":"This is a message from a bot", "props":{"attachments": [{"pretext": "Look some text","text": "This is text"}]}}' -H 'Authorization: Bearer <bot-access-token>' <mattermost-url>/api/v4/posts ``` ### 复现步骤 / Steps to reproduce 无法直接使用bot,仅能通过真是账户验证登录才可使用 ### 日志 / Logs <details> mattermost api error: unexpected status code: 401, resp: {"id":"api.user.login.bot_login_forbidden.app_error","message":"Bot login is forbidden.","detailed_error":"","request_id":"rursbe98ytb1mgcwrrgrhof54r","status_code":401} </details> ### 其他 / Miscellaneous _No response_ ### 贡献 / Contribution - [ ] 我乐意为此贡献代码! / I am interested in contributing to this issue!
kerem 2026-03-03 01:03:59 +03:00
Author
Owner

@fudiwei commented on GitHub (Jun 5, 2025):

你应该用 Webhook 通知渠道。

<!-- gh-comment-id:2943291137 --> @fudiwei commented on GitHub (Jun 5, 2025): 你应该用 Webhook 通知渠道。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#520
No description provided.