Use const where possible
This commit is contained in:
parent
72a0d10c19
commit
b45d3bc9fb
3 changed files with 6 additions and 6 deletions
|
@ -19,8 +19,8 @@ module.exports = async function (message, args) {
|
|||
if (isNaN(timeInSeconds)) {
|
||||
return "Please specify a time, and a message to send after the timer has finished"
|
||||
}
|
||||
let customMessage = args.slice(1).join(" ")
|
||||
let reminderTime = currentUnixTime + timeInSeconds
|
||||
const customMessage = args.slice(1).join(" ")
|
||||
const reminderTime = currentUnixTime + timeInSeconds
|
||||
let newTimerID;
|
||||
const db = new sqlite3.Database(databasePath)
|
||||
let sendText = await new Promise((resolve, reject)=>{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = function(time, currentUnixTime){
|
||||
let timeInSeconds = parseFloat(time)
|
||||
const letterCount = time.length - timeInSeconds.toString().length;
|
||||
let letter = time.slice(time.length - letterCount);
|
||||
const letter = time.slice(time.length - letterCount);
|
||||
switch (letter.toUpperCase()) {
|
||||
case "H":
|
||||
timeInSeconds = timeInSeconds * 3_600;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
module.exports = function(targetTime) {
|
||||
let countDownDate = new Date(targetTime).getTime();
|
||||
let now = new Date().getTime();
|
||||
const countDownDate = new Date(targetTime).getTime();
|
||||
const now = new Date().getTime();
|
||||
|
||||
let distance = countDownDate - now;
|
||||
const distance = countDownDate - now;
|
||||
let days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
||||
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
||||
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue