Discord連携ガイド / Discord Integration
- 日本語
- English
- 简体中文
💬 AIの報告をDiscordで受け取る
エージェントがCronジョブで自律実行した結果を、スマホのDiscordアプリで即座に受け取れるのは非常に便利です。このガイドでは、Webhook(ウェブフック)を使ったDiscord連携方法を解説します。
sequenceDiagram
participant Cron as ⏰ Cronタイマー
participant Agent as 🤖 AIエージェント
participant Webhook as 🔗 Discord Webhook
participant You as 📱 あなた (Discord)
Cron->>Agent: 毎朝8時に起動
Agent->>Agent: ニュースを収集・要約
Agent->>Webhook: HTTP POST(要約テキスト)
Webhook->>You: Discordチャンネルに通知!
Step 1: Discord Webhookの作成
- Discordの目的のサーバーを開きます。
- 通知を受けたいチャンネル名を右クリック → 「チャンネルの編集」。
- 左メニューの 「連携サービス」 → 「ウェブフック」 → 「新しいウェブフック」。
- 好きな名前(例:「AIレポーター」)を付け、URLをコピーします。
Step 2: Webhookの設定
取得したURLをワークスペースの設定に追加します。
agents/main/agent/auth-profiles.json
{
"api_keys": {
"CEREBRAS_API_KEY": "csk-...",
"DISCORD_WEBHOOK_URL": "https://discord.com/api/webhooks/xxxxx/yyyyy"
}
}
Step 3: AIに通知を依頼する
Cronジョブや対話の中で、以下のようにAIに指示を出します。
ニュースの要約が完成したら、Discord Webhookを使って
結果をDiscordチャンネルに投稿してください。
curlコマンドでPOSTリクエストを送ってください。
AIは以下のようなcurlコマンドを自動生成して実行します:
curl -H "Content-Type: application/json" \
-d '{"content": "🤖 おはようございます!本日のAIニュース要約です…"}' \
"$DISCORD_WEBHOOK_URL"
活用のヒント
- 朝のニュース要約: Cronで毎朝8時起動 → RSS取得 → 要約 → Discord送信
- エラー監視の即通知: サーバーのログにエラーを検知 → 即座にDiscordアラート
- 日報の自動投稿: 1日の作業ログを集計 → 夕方6時に日報として送信
💬 Receive AI Reports via Discord
It's incredibly convenient to receive the results of an agent's autonomous Cron execution directly on your smartphone's Discord app. This guide explains how to set up Discord integration using Webhooks.
sequenceDiagram
participant Cron as ⏰ Cron Timer
participant Agent as 🤖 AI Agent
participant Webhook as 🔗 Discord Webhook
participant You as 📱 You (Discord)
Cron->>Agent: Wake up at 8 AM
Agent->>Agent: Collect & summarize news
Agent->>Webhook: HTTP POST (summary text)
Webhook->>You: Notification in Discord channel!
Step 1: Create a Discord Webhook
- Open your target Discord server.
- Right-click the channel name → "Edit Channel."
- Navigate to "Integrations" → "Webhooks" → "New Webhook."
- Give it a name (e.g., "AI Reporter") and copy the URL.
Step 2: Configure the Webhook
Add the URL to your workspace configuration:
agents/main/agent/auth-profiles.json
{
"api_keys": {
"CEREBRAS_API_KEY": "csk-...",
"DISCORD_WEBHOOK_URL": "https://discord.com/api/webhooks/xxxxx/yyyyy"
}
}
Step 3: Instruct the AI to Notify
In your Cron job or conversation, instruct the AI:
After completing the news summary, please use the Discord Webhook
to post the result to the channel.
Send an HTTP POST request via curl.
The AI will automatically generate and execute a curl command like:
curl -H "Content-Type: application/json" \
-d '{"content": "🤖 Good morning! Here is today AI news summary…"}' \
"$DISCORD_WEBHOOK_URL"
Use Case Ideas
- Morning News Digest: Cron at 8 AM → Fetch RSS → Summarize → Send to Discord
- Instant Error Alerts: Detect errors in server logs → Immediate Discord alert
- Automated Daily Report: Aggregate day's activity logs → Post at 6 PM
💬 通过 Discord 接收 AI 报告
在智能手机的 Discord 应用上即时接收代理自主定时执行后的结果,非常方便。本指南介绍如何使用 Webhook 实现 Discord 集成。
sequenceDiagram
participant Cron as ⏰ 定时器
participant Agent as 🤖 AI 代理
participant Webhook as 🔗 Discord Webhook
participant You as 📱 您 (Discord)
Cron->>Agent: 每天早上8点唤醒
Agent->>Agent: 采集并总结新闻
Agent->>Webhook: HTTP POST(摘要文本)
Webhook->>You: Discord 频道收到通知!
第一步:创建 Discord Webhook
- 打开目标 Discord 服务器。
- 右键点击目标频道名 → "编辑频道"。
- 导航至 "集成" → "Webhook" → "新 Webhook"。
- 为其命名(例如:"AI 报告员")并复制 URL。
第二步:配置 Webhook
将 URL 添加到工作空间配置中:
agents/main/agent/auth-profiles.json
{
"api_keys": {
"CEREBRAS_API_KEY": "csk-...",
"DISCORD_WEBHOOK_URL": "https://discord.com/api/webhooks/xxxxx/yyyyy"
}
}
第三步:指示 AI 发送通知
在 Cron 任务或对话中,如下指示 AI:
新闻摘要完成后,请使用 Discord Webhook
将结果发布到频道中。
请通过 curl 命令发送 HTTP POST 请求。
AI 将自动生成并执行如下命令:
curl -H "Content-Type: application/json" \
-d '{"content": "🤖 早上好!以下是今天的 AI 新闻摘要……"}' \
"$DISCORD_WEBHOOK_URL"
应用灵感
- 早间新闻摘要:每天早上8点定时 → 抓取 RSS → 总结 → 发送至 Discord
- 即时错误警报:检测到服务器日志中的错误 → 立即向 Discord 发送警报
- 自动日报投递:汇总当天的工作日志 → 傍晚6点以日报形式发送