Mattermost 通道
通过 Mattermost 与 Moltbot 进行交互。
先决条件
- Mattermost 实例(自托管或 Mattermost Cloud)
- 具有 Bot 账号的访问令牌
- 必要的权限
配置
创建 Bot 账号
- 登录 Mattermost 系统控制台
- 集成 → Bot 账号 → 添加 Bot 账号
- 设置用户名和显示名称
- 复制访问令牌
添加通道
bash
moltbot channels add --channel mattermost \
--account default \
--server-url https://your-mattermost.example.com \
--token your-access-token使用
发送消息
bash
moltbot message send --channel mattermost --target ~channel-name --message "Hello from Moltbot!"频道消息
bash
# 发送到公开频道
moltbot message send --channel mattermost --target ~town-square --message "Announcement!"
# 发送到私信
moltbot message send --channel mattermost --target @username --message "Direct message"消息操作
bash
# 添加反应
moltbot message react --channel mattermost --target post-id --emoji "thumbsup"
# 搜索消息
moltbot message search --channel mattermost --query "search term"功能
支持的功能
- ✅ 文本消息和代码块
- ✅ 频道和私信
- ✅ 消息编辑和删除
- ✅ 表情反应
- ✅ 附件上传
- ✅ 线程回复
- ✅ 消息已读状态
- ⚠️ 斜杠命令(需要配置)
限制
- 附件大小限制(服务器配置)
- 某些企业版功能可能受限
故障排除
连接问题
bash
# 检查服务器连接
moltbot channels status --channel mattermost
# 测试服务器 URL
curl -I https://your-mattermost.example.com权限问题
确保 Bot 账号具有以下权限:
post:channelpost:channel:writeread:channelread:userread:user/access_token