Add timer show command

This command shows information about the timer with the ID you have as
an argument.
This commit is contained in:
SileNce5k 2023-05-09 09:44:24 +02:00
parent 5317d59e9a
commit 354d4cd098
2 changed files with 15 additions and 0 deletions

12
util/timer/showTimer.js Normal file
View file

@ -0,0 +1,12 @@
const fs = require('fs');
module.exports = function (client, authorID, timerID) {
let timerToShow = client.timers.find(timer => timer.ID === parseInt(timerID));
if (timerToShow === undefined)
return "Timer not found";
if (timerToShow.user !== authorID){
return "You can only show info about your own timers.";
}
return `${timerToShow.ID} will remind you <t:${timerToShow.reminderDate.toFixed(0)}:R> (<t:${timerToShow.reminderDate.toFixed(0)}:f>) with the message "${timerToShow.customMessage}"`;
}