I have been trying to make a simple timeout command for my discord but using the GuildMmber#timeout() method. here is the following code that I wrote to do that:
const seconds = interaction.options.getInteger('seconds');
const minutes = interaction.options.getInteger('minutes');
const hours = interaction.options.getInteger('hours');
const days = interaction.options.getInteger('days');
const weeks = interaction.options.getInteger('weeks');
var totalTime = seconds + (minutes * 60) + (hours * 3600) + (days * 86400) + (weeks * 604800);
if (seconds && minutes && hours && days && weeks === null || 0) { totalTime = 900; member.timeout(totalTime, reason)
.then(() => { console.log('Timed user out for ' + totalTime + ' seconds.')
})
A timeout is issued for the user, but the user is given a much shorter timeout in the actual app. For example, if I timeout the user for a week, the actual timeout given is only 8 minutes, even though the debug message near the end of the code prints the right amount of seconds stored in the totalTime variable used to set the timeout length:
Timed user out for 604800 seconds.