Gateway › Discord

Discord

Tổng quan

Server đóng vai group, channel là topic, thread thuộc topic của channel cha.

Tạo application & bot

  1. Developer Portal → New Application; application id là <APP_ID>.
  2. Bot → Reset Token để lấy bot token.
  3. Bật SERVER MEMBERS INTENT và MESSAGE CONTENT INTENT.

Thiếu intent: lưu trên Integrations nói rõ intent nào; bot đang chạy dừng retry — Monitor → Gateway → View log cho biết lý do. Bật intent, rồi Monitor → Gateway → Restart.

Mời bot

https://discord.com/oauth2/authorize?client_id=<APP_ID>&scope=bot%20applications.commands&permissions=274878024768
Scope / quyềnÝ nghĩa
applications.commandsCho bot đăng ký slash command.
274878024768Đúng 7 quyền: View Channels, Send Messages, Send in Threads, Read Message History, Add Reactions, Attach Files, Embed Links.

Thiết lập credentials

Trên trang Integrations của web app → Gateways → Create trên dòng discord (Bot token, Owner user id), rồi Enable. Credentials được agent-hub lưu lại, không phải .env.

Lấy id bằng Settings → Advanced → Developer Mode rồi chuột phải → Copy ID. Owner đã có trên Telegram giữ nguyên tài khoản và nhận thêm danh tính Discord.

Nếu muốn một lane mặc định cho các tin không rõ đích, mở Settings ở dòng Discord trên trang Integrations (thẻ Gateways) và đặt Fallback target là discord:<guild_id>:<channel_id>.

Sử dụng

Lệnh bắt đầu bằng / — qua slash command gốc hoặc nhập như chữ thường đều được; xem Lệnh trong chat.

  • /project add ở bất kỳ channel nào gắn cả server với một project.
  • Slash command /agent /ask /scope /project /user; lệnh global có thể mất tới 1 giờ để hiện, lệnh text chạy ngay.
  • Thành viên join sau bot tự đăng ký; người có sẵn: /user add @name.
  • Chủ server = group creator; role Administrator = admin.
  • Thread riêng tư chỉ thấy khi bot được thêm vào thread.