8
n8n 中文网amn8n.com

AI Discord 机器人回复提及和私信,具有上下文感知能力

高级

这是一个Support, AI, IT Ops领域的自动化工作流,包含 18 个节点。主要使用 If, Set, Discord, Webhook, DiscordTool 等节点,结合人工智能技术实现智能自动化。 上下文感知的 Discord 机器人使用 GPT-4o 回复提及和私信

前置要求
  • Discord Bot Token 或 Webhook
  • HTTP Webhook 端点(n8n 会自动生成)
  • OpenAI API Key
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "h7STFu0NJCVsvlbc",
  "meta": {
    "instanceId": "ff93c7924b638fb6ca7815d8ed0b9e89bc1a4b863863649bb0ed513cdccf1946"
  },
  "name": "AI Discord 机器人回复提及和私信,具有上下文感知能力",
  "tags": [],
  "nodes": [
    {
      "id": "b69efca3-f0b1-4b8d-8812-9bbc60d2c9c7",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        520,
        500
      ],
      "parameters": {},
      "typeVersion": 1.8
    },
    {
      "id": "c2461069-028e-4a6f-9670-c75e84f30d26",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        280,
        860
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "87dfab19-9acc-48af-b786-1c20106f8e23",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        480,
        880
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "74407b9a-d9ae-434e-9eee-17b68b487c2e",
      "name": "为代理映射数据",
      "type": "n8n-nodes-base.set",
      "position": [
        180,
        500
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "a2a7e4e9-084c-4bdf-80e0-5f909a53fe2d",
      "name": "机器人应在私信或公共频道中回复",
      "type": "n8n-nodes-base.if",
      "position": [
        900,
        500
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "d84d2f02-93b8-4459-82de-bff394ee7455",
      "name": "在私信中回复",
      "type": "n8n-nodes-base.discord",
      "position": [
        1240,
        360
      ],
      "webhookId": "9ad5e961-607d-47ed-a461-2f89a90255e6",
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "ff8b9e70-35d1-44de-aba0-e624b468b95f",
      "name": "在公共频道中回复",
      "type": "n8n-nodes-base.discord",
      "position": [
        1240,
        640
      ],
      "webhookId": "9ad5e961-607d-47ed-a461-2f89a90255e6",
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "1abd9619-bd4c-493c-a90f-7db16b3cc72d",
      "name": "收到私信",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -80,
        260
      ],
      "webhookId": "7ee4637e-8a29-4084-9c44-fc017eb79db8",
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "40fdef9c-e568-4e75-a93e-e20cc9601835",
      "name": "公共提及",
      "type": "n8n-nodes-discord-trigger.discordTrigger",
      "position": [
        -80,
        720
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e1d15d1b-99cd-4b1d-8006-47af3b355143",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        140
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b3b58996-44f5-466e-aeaf-9a163e376e38",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -100
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "583e5a8d-d7f5-4bc6-8d3c-8b47c3d96799",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        500
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3f320db7-1109-4089-8bc9-3c26efe8cd46",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        40
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7bb34978-a5db-4d2d-9853-f8dbbe584c8a",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        760
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "777c1988-3d18-454f-8310-3d647d0ff6ff",
      "name": "读取最近的公共消息",
      "type": "n8n-nodes-base.discordTool",
      "position": [
        840,
        900
      ],
      "webhookId": "8dc45278-105e-440d-a71e-08d680a56a6b",
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "10859678-99e8-4ac8-aa05-aeddb25bc816",
      "name": "读取最近的私密消息",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        1020,
        900
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "5d4bb3fb-b1be-4fcd-a5f3-fbe7cc4aa38f",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        740
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b09f12af-1a4f-45ba-9073-d38dc5e93ad1",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        200
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b15c5cde-bce6-4fa2-8803-0f7dfe8cbb71",
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Either the bot should reply in dm or in public channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DM Received": {
      "main": [
        [
          {
            "node": "Mapping data for the Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Public Mention": {
      "main": [
        [
          {
            "node": "Mapping data for the Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Read last public messages": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Mapping data for the Agent": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read last private messages": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Either the bot should reply in dm or in public channel": {
      "main": [
        [
          {
            "node": "Reply in DM",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reply in public channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 客户支持, 人工智能, IT 运维

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量18
分类3
节点类型11
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Niten Musa

Niten Musa

@nitenmusa

Just like every business has its own processes, every business will have its own AI agents — I sell and teach that transition From France 🇫🇷 — Discipline, Humility, Benevolence

外部链接
在 n8n.io 查看

分享此工作流