Skip to content

触发 Slash Command

提示

请务必先阅读如何正确使用酒馆助手

我们可以在嵌入的 iframe 中执行 SillyTavern 内部的 Slash 命令 (斜杠命令), 如 /run/echo 等。 点击查看对应类型定义文件(可发给AI或IDE使用,酒馆助手设置中提供了打包下载)

参考

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

triggerSlash

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

typescript
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, 青空莉想做舞台少女的狗