导入酒馆数据
提示
请务必先阅读如何正确使用酒馆助手
点击查看对应类型定义文件 (可发给 AI 或 IDE 使用, 酒馆助手界面中提供了打包下载)
importRawCharacter
像酒馆界面里那样导入角色卡
ts
function importRawCharacter(filename: string, content: Blob): Promise<Response>;
参数
filename
- 类型:
string
- 描述: 角色卡名
content
- 类型:
Blob
- 描述: 角色卡文件内容
示例
ts
const response = await fetch(角色卡网络链接);
await importRawCharacter(角色卡名, await response.blob());
importRawChat
像酒馆界面里那样导入聊天文件, 目前仅能导入到当前选择的角色卡
ts
function importRawChat(filename: string, content: string): Promise<Response>;
参数
filename
- 类型:
string
- 描述: 聊天文件名, 由于酒馆限制, 它实际不会作为最终导入的聊天文件名称
content
- 类型:
string
- 描述: 聊天文件内容
示例
ts
const response = await fetch(聊天文件网络链接);
await importRawChat(聊天文件名, await response.text());
importRawPreset
像酒馆界面里那样导入预设
ts
function importRawPreset(filename: string, content: string): Promise<Response>;
参数
filename
- 类型:
string
- 描述: 预设文件名
content
- 类型:
string
- 描述: 预设文件内容
示例
ts
const response = await fetch(预设网络链接);
await importRawPreset(预设名, await response.text());
importRawWorldbook
像酒馆界面里那样导入世界书
ts
function importRawWorldbook(filename: string, content: string): Promise<Response>;
参数
filename
- 类型:
string
- 描述: 世界书文件名
content
- 类型:
string
- 描述: 世界书文件内容
示例
ts
const response = await fetch(世界书网络链接);
await importRawWorldbook(世界书名, await response.text());
importRawTavernRegex
像酒馆界面里那样导入酒馆正则
ts
function importRawTavernRegex(filename: string, content: string): boolean;
参数
filename
- 类型:
string
- 描述: 酒馆正则文件名
content
- 类型:
string
- 描述: 酒馆正则文件内容
示例
ts
const response = await fetch(酒馆正则网络链接);
await importRawTavernRegex(酒馆正则名, await response.text());