Gmail 集成
配置
yaml
automation:
gmail:
enabled: true
credentials: ${GOOGLE_APPLICATION_CREDENTIALS}
pubsub:
topic: projects/{project}/topics/moltbot
labels:
- INBOX
- CLAWDBOT设置步骤
- 在 Google Cloud Console 创建项目
- 启用 Gmail API
- 创建服务账户
- 下载 JSON 凭证
- 配置 Pub/Sub 主题
功能
- 📧 自动读取新邮件
- ✉️ 发送邮件回复
- 📂 邮件分类
- 🔍 邮件搜索
示例
javascript
// 读取未读邮件
const emails = await moltbot.gmail.list({
label: 'INBOX',
unread: true
});
// 发送邮件
await moltbot.gmail.send({
to: 'user@example.com',
subject: '自动回复',
body: '收到您的邮件,我会尽快回复。'
});