Skip to content

Discord 设置 ​

每个角色对应一个 Discord application。

  1. 在 Discord Developer Portal 创建 application,在 Bot 页面复制 token,写进 .env(如 DISCORD_LUNA_TOKEN: …)。
  2. 在 Bot → Privileged Gateway Intents 打开 Message Content Intent,否则 bot 读不到普通消息。
  3. 在 OAuth2 → URL Generator 勾选 bot 和 applications.commands,权限选 View Channels、Send Messages、Read Message History、Send Messages in Threads、Attach Files、Add Reactions。不需要 Administrator。
  4. 用生成的链接把 bot 邀请进服务器,把服务器 ID 和频道 ID 填进 discord.guilds(开发者模式下右键复制 ID)。

启动时每个角色会在其服务器注册斜杠命令。回复是 Discord Markdown,单条超过 2000 字符会分段发送,并且不会产生 @ 通知。

BSD 2-Clause 许可