mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 12:45:51 +00:00
Update commands.js
This commit is contained in:
@@ -4,6 +4,7 @@ import { extensionName } from "../utils/settings.js";
|
|||||||
import { SlashCommand } from "/scripts/slash-commands/SlashCommand.js";
|
import { SlashCommand } from "/scripts/slash-commands/SlashCommand.js";
|
||||||
import { SlashCommandParser } from "/scripts/slash-commands/SlashCommandParser.js";
|
import { SlashCommandParser } from "/scripts/slash-commands/SlashCommandParser.js";
|
||||||
import { checkAndFixWithAPI } from "./api.js";
|
import { checkAndFixWithAPI } from "./api.js";
|
||||||
|
import { amilyHelper } from './tavern-helper/main.js';
|
||||||
|
|
||||||
async function checkLatestMessage() {
|
async function checkLatestMessage() {
|
||||||
const context = getContext();
|
const context = getContext();
|
||||||
@@ -94,9 +95,12 @@ export async function fixCommand() {
|
|||||||
result.optimizedContent &&
|
result.optimizedContent &&
|
||||||
result.optimizedContent !== latestMessage.mes
|
result.optimizedContent !== latestMessage.mes
|
||||||
) {
|
) {
|
||||||
latestMessage.mes = result.optimizedContent;
|
const messageId = chat.length - 1;
|
||||||
await saveChatConditional();
|
await amilyHelper.setChatMessage(
|
||||||
await reloadCurrentChat();
|
{ message: result.optimizedContent },
|
||||||
|
messageId,
|
||||||
|
{ refresh: 'display_and_render_current' }
|
||||||
|
);
|
||||||
toastr.success("回复已修复", "命令检查器");
|
toastr.success("回复已修复", "命令检查器");
|
||||||
} else {
|
} else {
|
||||||
toastr.info("未检测到需要修复的问题", "命令检查器");
|
toastr.info("未检测到需要修复的问题", "命令检查器");
|
||||||
|
|||||||
Reference in New Issue
Block a user