Skip to content

触发 Slash Command

我们可以在嵌入的 iframe 中执行 SillyTavern 内部的 Slash 命令 (斜杠命令), 如 /run/echo 等。

参考

你可以在这些地方查看SillyTavern的全部 Slash(快速回复) 命令:

triggerSlash

运行 Slash 命令, 注意如果命令写错了将不会有任何反馈。

typescript
async function triggerSlash(command: string): Promise<string>;

参数

command

要运行的 Slash 命令

返回值

  • Slash 管道结果: 如果命令出错或执行了 /abort 则返回 undefined

示例

typescript
await triggerSlash('/echo hello!');
typescript
const last_message_id = await triggerSlash('/pass {{lastMessageId}}');

作者:KAKAA, 青空莉想做舞台少女的狗