
Product
Socket for Asana Is Now Available
Create and manage Asana tasks directly from Socket alerts, with manual task creation, automated ticketing rules, and two-way sync.
一个基于 Discord.js 的交互式机器人,集成 OpenCode 功能,支持私聊对话、定时任务和本地测试。
用户发送消息 → 存入 SQLite 消息队列
↓
每 2 秒轮询取出一条
↓
调用 OpenCode 处理(单线程)
↓
处理完成后发送回复给用户
AI 调用 CLI 命令 → 添加/删除任务到 DB
↓
每分钟检查任务是否到期
↓
到期任务 → 插入消息队列
↓
OpenCode 处理 → 发送给用户
SKILL.md # 项目根目录的 Skill 文件
↓ 启动时自动复制(根据 name 字段)
.opencode/skills/schedule/SKILL.md
↓
OpenCode 加载 Skill
↓
AI 根据指南调用 CLI 命令
↓
CLI 操作数据库
SKILL.md 放在项目根目录,会被 Git 追踪name 字段复制到 .opencode/skills/{name}/git clone https://github.com/958877748/skills.git
cd discord-bot
npm install
# 方式一:使用 CLI 配置
dm-bot config --token <your-token>
# 方式二:环境变量
export DISCORD_TOKEN=<your-token>
# 生产环境
npm start
# 开发环境(带自动重启)
npm run dev
# Mock 模式(本地测试,无需 Discord 连接)
dm-bot --mock
# 启动机器人
dm-bot start [--token <token>] [--mock]
# 配置
dm-bot config --token <token>
# 重置数据库
dm-bot reset
# 定时任务管理
dm-bot schedule create "<cron>" "<content>" [repeat]
dm-bot schedule list
dm-bot schedule delete <id>
# 创建每天8点的提醒
dm-bot schedule create "0 8 * * *" "提醒喝水" true
# 创建工作日9:30的提醒
dm-bot schedule create "30 9 * * 1-5" "开会" true
# 创建一次性提醒
dm-bot schedule create "0 10 1 * *" "月初提醒" false
# 查看所有任务
dm-bot schedule list
# 删除任务
dm-bot schedule delete 1
┌───────────── 分钟 (0-59)
│ ┌───────────── 小时 (0-23)
│ │ ┌───────────── 日 (1-31)
│ │ │ ┌───────────── 月 (1-12)
│ │ │ │ ┌───────────── 星期 (0-6, 0=周日)
│ │ │ │ │
* * * * *
用于本地测试,无需真实的 Discord 连接:
# 交互式 Mock 模式
dm-bot --mock
# 非交互式 Mock 模式(代码调用)
const { startBot } = require('./index');
await startBot({ mock: 'non-interactive' });
discord-bot/
├── bin/cli.js # CLI 入口
├── index.js # 主入口文件
├── db.js # 数据库操作模块
├── mock.js # Mock 模式支持
├── package.json # 项目配置
└── skills/ # Skill 源文件目录
└── schedule/
└── SKILL.md # 定时任务 Skill(AI 指南)
# 启动后自动生成(在 .gitignore 中)
.opencode/
└── skills/ # 从 skills/ 复制而来
└── schedule/
└── SKILL.md
使用 SQLite 存储数据:
message_queue - 消息队列表user_sessions - 用户 Session 表(对话上下文)scheduled_tasks - 定时任务表数据库文件会自动创建,无需手动初始化。
.env 文件提交到版本控制*.db) 不会被 Git 追踪FAQs
Interactive Discord bot with OpenCode integration
The npm package dm-bot receives a total of 97 weekly downloads. As such, dm-bot popularity was classified as not popular.
We found that dm-bot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Create and manage Asana tasks directly from Socket alerts, with manual task creation, automated ticketing rules, and two-way sync.

Security News
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.