Fix crash if timer doesn't exist
This commit is contained in:
parent
6e8faadd97
commit
56e8f4765d
1 changed files with 4 additions and 4 deletions
|
@ -11,11 +11,11 @@ module.exports = async function (authorID, timerID) {
|
|||
console.error("Error while trying to read timer from database: ", error)
|
||||
reject(error);
|
||||
}else{
|
||||
if(authorID !== timer.user){
|
||||
sendText = "This timer does not belong to you."
|
||||
}
|
||||
else if(timer === undefined){
|
||||
if(timer === undefined){
|
||||
sendText = "Timer not found";
|
||||
}
|
||||
else if(authorID !== timer.user){
|
||||
sendText = "This timer does not belong to you."
|
||||
}else{
|
||||
sendText = `${timer.ID} will remind you <t:${timer.reminderTime.toFixed(0)}:R> (<t:${timer.reminderTime.toFixed(0)}:f>), with the message being:\n${timer.customMessage}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue