缺少)在参数列表之后,这次我把它放在哪里

missing ) after argument list, where do i put it this time?

本文关键字:在哪里 参数 列表 之后 缺少      更新时间:2023-09-26
if (typeof scriptLoadedMeowPuff === "undefined") {
var scriptLoadedMeowPuff = true;
var MTYPEWON = 0;
// when a message is recieved in chat...
MPP.client.on("a", (msg) => {
        if (msg.a.indexOf(MPP.client.getOwnParticipant().name + "First person ") !== -1 && msg.p._id === ("903bcaadc5c62dbf197798a0")) {
        MPP.chat.send("msg.p.a".split("First person to type this wins: "))
        }
    }
};
    console.log("%c You already pasted the script, " + MPP.client.getOwnParticipant().name + "!'n'n Refresh and paste the code again to see any changes.", "background: #000; color: #ff3333");
};

这应该更适合您:

if (typeof scriptLoadedMeowPuff === "undefined") {
var scriptLoadedMeowPuff = true;
var MTYPEWON = 0;
// when a message is recieved in chat...
MPP.client.on("a", (msg) => {
        if (msg.a.indexOf(MPP.client.getOwnParticipant().name + "First person ") !== -1 && msg.p._id === ("903bcaadc5c62dbf197798a0")) {
        MPP.chat.send("msg.p.a".split("First person to type this wins: "));
        }
    }
);
    console.log("%c You already pasted the script, " + MPP.client.getOwnParticipant().name + "!'n'n Refresh and paste the code again to see any changes.", "background: #000; color: #ff3333");
}

编辑 哦,弗雷恩先到了那里,嗯。

问题出在MPP.client.on(上,你以(开头但以}结尾,并且不需要在if条件后使用该语句,你在父if条件中这样做了。

if (typeof scriptLoadedMeowPuff === "undefined") {
  var scriptLoadedMeowPuff = true;
  var MTYPEWON = 0;
  // when a message is recieved in chat...
  MPP.client.on("a", (msg) => {
    if (msg.a.indexOf(MPP.client.getOwnParticipant().name + "First person ") !== -1 && msg.p._id === ("903bcaadc5c62dbf197798a0")) {
      MPP.chat.send("msg.p.a".split("First person to type this wins: "));
    }
  });
  console.log("%c You already pasted the script, " + MPP.client.getOwnParticipant().name + "!'n'n Refresh and paste the code again to see any changes.", "background: #000; color: #ff3333");
}