mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🔧 build: 工程化变量
This commit is contained in:
parent
3f6fdf5aa7
commit
60c8763b9d
@ -21,11 +21,11 @@ import { ChatGPTBrowserClient } from "@waylaidwanderer/chatgpt-api";
|
||||
import { av2BV } from "../utils/bilibili-bv-av-convert.js";
|
||||
import querystring from "querystring";
|
||||
|
||||
// 构造关键字,防止超出预期的问题
|
||||
const existsTransKey = Object.keys(transMap).join("|");
|
||||
const existsPromptKey = Object.keys(PROMPT_MAP).join("|").slice(0, -1);
|
||||
|
||||
export class tools extends plugin {
|
||||
// 构造关键字,防止超出预期的问题
|
||||
static existsTransKey = Object.keys(transMap).join("|");
|
||||
static existsPromptKey = Object.keys(PROMPT_MAP).join("|").slice(0, -1);
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
name: "R插件工具和学习类",
|
||||
@ -34,11 +34,11 @@ export class tools extends plugin {
|
||||
priority: 500,
|
||||
rule: [
|
||||
{
|
||||
reg: `^(翻|trans)[${existsTransKey}]`,
|
||||
reg: `^(翻|trans)[${tools.existsTransKey}]`,
|
||||
fnc: "trans",
|
||||
},
|
||||
{
|
||||
reg: `^#(ocr|OCR)(${existsPromptKey})?$`,
|
||||
reg: `^#(ocr|OCR)(${tools.existsPromptKey})?$`,
|
||||
fnc: "ocr2anything",
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user