问一下,Hamibot脚本如何自定义类
已存档
写了个简单的示例代码
auto.waitFor();
class User {
constructor(id, name) {
this.id = id
this.name = name
}
Getid() {
return this.id
}
Getname() {
return this.name
}
}
let 张三 = new User(123, '张三')
toastLog(张三.Getid())
运行后报错,日志提示identifier is a reserved word