
Lv.1
dianmao12171682
在 【教程】如何让管喵在聊天区执行代码时可以用await 中回复
const adminList=["这里是管喵列表,填名字"];
world.onChat(async({entity:{player:{name:name}},message:message})=>{
if(message.startsWith("$")&&adminList.includes(name)){
let c=message.slice(1);
world.say(`~> ${c}`);
try{
c=await eval(`!async function(){${c}}`)
}
catch(a){
c=a
}
finally{
world.say(`<~ ${c}`)
}
}
});2022-08-03T10:59:14 点赞:0