Gwuh
This commit is contained in:
parent
331cf5d172
commit
a7f1687588
8
index.js
8
index.js
|
@ -1321,10 +1321,10 @@ dcClient.on('interactionCreate', async interaction => {
|
|||
break;
|
||||
case "cdr": // Get CDR records for the user
|
||||
// default to beginning of time
|
||||
let userStartDate = interaction.options.getString("start_date").match(/^\d{2}\/\d{2}\/\d{4}$/)[0] // regex this to mm/dd/yyyy
|
||||
let userEndDate = interaction.options.getString("end_date").match(/^\d{2}\/\d{2}\/\d{4}$/)[0] // regex this to mm/dd/yyyy
|
||||
let startDate = new Date(userStartDate) || new Date(0);
|
||||
let endDate = new Date(userEndDate) || new Date();
|
||||
let userStartDate = interaction.options.getString("start_date")?.match(/^\d{2}\/\d{2}\/\d{4}$/)?.[0] || new Date(0); // regex this to mm/dd/yyyy
|
||||
let userEndDate = interaction.options.getString("end_date")?.match(/^\d{2}\/\d{2}\/\d{4}$/)?.[0] || new Date(); // regex this to mm/dd/yyyy
|
||||
let startDate = new Date(userStartDate);
|
||||
let endDate = new Date(userEndDate);
|
||||
await interaction.deferReply({
|
||||
ephemeral: true
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue