缺少)在参数列表之后,这次我把它放在哪里
missing ) after argument list, where do i put it this time?
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");
}
相关文章:
- 在哪里使用名为“;冻结”;
- Ember.js-接口状态应该存储在哪里
- 在Redux中,我应该在哪里编写复杂的异步流
- 在哪里可以学习ECMAScript标准中尚未包含的JavaScript功能
- 在哪里可以找到RXUI Javascript'时间飞逝'实例
- Redux应用程序结构-在哪里放置服务/业务逻辑
- 在哪里可以找到'项目'在plothover函数中
- Javascript-在哪里放置常量,全局或本地
- Sequelize:这些方法应该驻留在哪里
- AJAX更新面板不;t工作.请帮我找出我错在哪里.
- 在哪里存储HTML模板以在Backbone.js中使用
- 在JS参数中放置引号
- ForerunnerDB将其数据库保存在哪里
- 在哪里可以找到R-to-JavaScript编译器
- 很棒的共享按钮application.coffee文件在哪里
- WinJs中的视图状态更改事件在哪里
- 在哪里可以找到有关 Javascript 特定参数语法的更多信息?(里面的例子)
- 在哪里可以获得有关 JavaScript 函数的对象参数语法的信息
- 我的错误在哪里?未捕获的SyntaxError: missing)参数列表后
- 我在哪里为WP TinyMCE设置初始化参数?