就是这样
教程?
没有
能干什么?
注入
???
好吧,第一次注入需要注意什么?
用js,轻点
??????
-----------------分割线----------------------
这里有个栗子
教程?
没有
能干什么?
注入
???
好吧,第一次注入需要注意什么?
用js,轻点
??????
-----------------分割线----------------------
这里有个栗子
支持 Blockly 2.0
上学好快
美少女也好快
上学拍了拍 yexiaoquan
狠狠注入了
这样用js写的插件也不用发插件市场了()
码了个翻译插件 贴这里好了
import { Time } from "koishi"
import { JSONPath as parseJson } from "jsonpath-plus"
export const name = "百度翻译"
export const using = []
export async function apply(ctx){
const logger = ctx.logger("百度翻译")
function mathRandomInt(a, b) {
if (a > b) {
// Swap a and b to ensure a is smaller.
var c = a;
a = b;
b = c;
}
return Math.floor(Math.random() * (b - a + 1) + a);
}
var appid = '';
var 密钥 = '';
ctx.command('百度').action(async ({session},...args)=>{}); function md5(str) {const crypto = require('crypto');const hash = crypto.createHash('md5').update(str).digest('hex');return hash;} ctx.command('百度/翻译 <message:text>').action(async ({session},...args)=>{
{
let 局部变量1 = 0, q = args[0], 随机码 = mathRandomInt(1000000000, 9999999999), form = 'auto', to = 'zh';
局部变量1 = [appid,q,随机码,密钥].join('');
logger.success(局部变量1);
logger.debug((Time.template('yyyy-MM-dd hh:mm:ss',new Date((Math.round(new Date() )))))); 局部变量1 =md5(局部变量1); logger.debug((Time.template('yyyy-MM-dd hh:mm:ss',new Date((Math.round(new Date() ))))));
logger.success(局部变量1);
局部变量1 = ['http://api.fanyi.baidu.com/api/trans/vip/translate?q=',q,'&from=',form,'&to=',to,'&appid=',appid,'&salt=',随机码,'&sign=',局部变量1].join('');
logger.success(局部变量1);
局部变量1 = (await ctx.http.get(局部变量1,{responseType:"json"}));
logger.success(局部变量1);
return (await parseJson({path: "$.trans_result[0].dst", json: 局部变量1}));
}
});
}
插件名称: 百度翻译
导出时间: 2023/11/20 16:30:06
-=-=-=-=--=-=-=-=- BEGIN KOISHI BLOCKLY BLOCK V1 -=-=--=-=-=--=-=--=-=-=-
H4sIAAAAAAA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