Skip to content

快速开始 ​

准备 ​

  • Misskey 独立机器人账号及访问令牌
  • OpenAI 兼容服务的 API 密钥
  • Docker 与 Docker Compose

令牌按启用功能授权:

权限用途
read:account账号、时间线、天线
write:notes回复、发帖、引用、转帖
read:chat · write:chat读写聊天
read:drive · write:drive读取图片、上传生成图
write:reactionsRadar 反应
write:accountBond 个人备注同步(memo_sync)

部署 ​

bash
mkdir -p twipsybot/prompts && cd twipsybot
curl -fsSLO https://raw.githubusercontent.com/oreeke/twipsybot/main/docker-compose.yaml
docker compose up -d
docker compose exec twipsybot twipsybot cfg

首次启动缺少连接信息,在 connect 中填写:

misskey url、misskey token、ai base url、ai api key

bot 中修改 model

Ctrl+S 保存,约 2 秒后自动启动。按需修改 compose 中的 TZ。

模型服务

connect.ai_base_url 留空使用 OpenAI 官方端点,bot.model 默认使用 gpt-6-luna。

API 密钥与模型不在启动时校验,错误会在首次回复时写入日志;令牌或连接问题见故障排查:

bash
docker compose logs -f twipsybot

验证 ​

  1. 用其他账号 @ 机器人。
  2. 管理员私聊发送 ^status,确认模型与 mention、chat、autopost 开关。

配置热更新,带 ↻ 的字段需执行 docker compose restart twipsybot。

本地运行(可选) ​

需要 Python 3.12+ 与 uv:

bash
git clone https://github.com/oreeke/twipsybot.git && cd twipsybot
uv sync
uv run twipsybot cfg
uv run twipsybot run

systemd ​

/etc/systemd/system/twipsybot.service:

ini
[Unit]
Description=TwipsyBot Service
After=network.target

[Service]
Type=exec
WorkingDirectory=/path/to/twipsybot
ExecStart=/path/to/twipsybot/.venv/bin/twipsybot run
KillMode=control-group
TimeoutStopSec=5
Environment=PYTHONUNBUFFERED=1 PYTHONIOENCODING=utf-8

[Install]
WantedBy=multi-user.target
bash
sudo systemctl daemon-reload
sudo systemctl enable --now twipsybot
journalctl -u twipsybot -f