Fix: bot timer can't be negative or null.

This commit is contained in:
John Livingston
2025-05-21 17:12:14 +02:00
parent 1b8531a198
commit 8a12ddabc2

View File

@ -121,6 +121,15 @@ export class ChannelDetailsService {
} }
} }
for (const [i, q] of botConf.quotes.entries()) {
propertiesError[`bot.quotes.${i}.delay`] = []
if ((typeof q.delay !== 'number') || isNaN(q.delay)) {
propertiesError[`bot.quotes.${i}.delay`].push(ValidationErrorType.WrongFormat)
} else if (q.delay <= 0) {
propertiesError[`bot.quotes.${i}.delay`].push(ValidationErrorType.NotInRange)
}
}
for (const [i, cd] of botConf.commands.entries()) { for (const [i, cd] of botConf.commands.entries()) {
propertiesError[`bot.commands.${i}.command`] = [] propertiesError[`bot.commands.${i}.command`] = []