我正在尝试在 Discord 的 JSON 文件中创建对象构造函数。大型构造函数被命名为“person”,我希望其中的对象是 Discord 消息作者的名字,但我不能将变量命名为“msg.author.username”。我应该怎么办?
function person(name, violations, role) {
this.name = name;
this.violations = violations;
this.highestRole = role;
}
var (msg.author.username) = new person(msg.author.username, 1,
msg.member.highestRole.name)