parent
501a78b7c9
commit
8df6244363
2 changed files with 10 additions and 2 deletions
|
@ -17,14 +17,17 @@ module.exports = {
|
|||
}
|
||||
let customMessage = args.slice(1).join(" ");
|
||||
let reminderTime = currentUnixTime + timeInSeconds
|
||||
let newTimerID = ++client.lastTimerID;
|
||||
const newTimer = {
|
||||
"ID": newTimerID,
|
||||
"user": `${message.author.id}`,
|
||||
"reminderDate": reminderTime,
|
||||
"channel": `${message.channel.id}`,
|
||||
"customMessage": `${customMessage}`
|
||||
}
|
||||
fs.writeFileSync('data/lastTimerID.txt', newTimerID.toString());
|
||||
client.timers.push(newTimer);
|
||||
fs.writeFileSync('data/timers.json', JSON.stringify(client.timers, null, 4))
|
||||
message.channel.send(`I will remind you <t:${reminderTime.toFixed(0)}:R> (<t:${reminderTime.toFixed(0)}:f>)`);
|
||||
message.channel.send(`A new timer with ID:${newTimerID} created.\nI will remind you <t:${reminderTime.toFixed(0)}:R> (<t:${reminderTime.toFixed(0)}:f>)`);
|
||||
}
|
||||
};
|
|
@ -23,7 +23,12 @@ client.settings = new Discord.Collection();
|
|||
client.commands = new Discord.Collection();
|
||||
client.serverPrefixes = new Discord.Collection();
|
||||
client.netmodules = new Discord.Collection();
|
||||
client.timers = require('./data/timers.json')
|
||||
client.timers = require('./data/timers.json');
|
||||
|
||||
if(!fs.existsSync("./data/lastTimerID.txt")){
|
||||
fs.writeFileSync('./data/lastTimerID.txt', "0");
|
||||
}
|
||||
client.lastTimerID = parseInt(fs.readFileSync('./data/lastTimerID.txt', 'utf8'));
|
||||
|
||||
client.settings.set("presenceType", presenceType);
|
||||
client.settings.set("presenceText", presenceText);
|
||||
|
|
Loading…
Add table
Reference in a new issue