im试图将时间戳添加到附件文件中。我尝试使用新的Date.getTime来做到这一点,但这似乎不起作用
function init(cash){
try {
cash = getFullNumber(cash);
if(cash <= 0) return;
var userData = JSON.parse(fs.readFileSync(client.config.dataFolder + "/users/" + currentUser + ".json", "utf8"));
var arr = getMaxItems(userData, cash);
if(arr){
if(arr.length==0){
client.users.get(currentUser).send("You Need More Cash!");
} else {
var text = ahk(arr);
var file = client.config.dataFolder + "/ahks/" + getFileName();
fs.writeFileSync(file, text);
client.users.get(currentUser).send({
files: [{
//attachment: 'C:/Bot/Currently Running/Cafe Team Bot ver 2.3.0/test.ahk',
attachment: file,
name: 'opt.ahk'
}]
});
}
}
//if(str.length>0)
//client.users.get(currentUser).send(str + "\n`++++++++++++++++++++++++++++++`");
} catch(err){
console.log(err);
}
}