如何将多个ID添加到不一致.js检查中



我正在尝试制作一个简单的脚本,用于检查用户ID是否为脚本中的用户ID。

但我似乎想不通。

我希望你们能帮助我。

if(message.author.id !== '272412823148298240') return message.channel.send("you do not have permissions")

所以我想再添加2个ID,这样其他2个人也可以使用它。

只需将它们添加到一个数组中,然后检查当前作者的ID是否在该数组中:

const authorized = [
"272412823148298240",
"XXXXXXXXXXXXXXXXXX",
"YYYYYYYYYYYYYYYYYY"
];
if (!authorized.includes(message.author.id)){
return message.channel.send("you do not have permissions");
}