feat: add config input for the automated generation option

This commit is contained in:
cătălin 2024-11-01 16:10:50 +01:00
commit e574277839
No known key found for this signature in database
5 changed files with 55 additions and 39 deletions

View file

@ -32,7 +32,8 @@ class MarkovChain:
if self.s.help_message_timer > 0:
if self.s.help_message_timer < 300: # noqa: PLR2004
raise ValueError(
'Value for "HelpMessageTimer" in must be at least 300 seconds, or a negative number for no help messages.', # noqa: EM101
'Value for "HelpMessageTimer" in must be at least 300 seconds, ' # noqa: EM101
"or a negative number for no help messages.",
)
t = LoopingTimer(self.s.help_message_timer, self._command_help)
t.start()
@ -44,6 +45,9 @@ class MarkovChain:
'Value for "Automatic_generation_message" must be at least 30 seconds, or a negative number for no ' # noqa: EM101
"automatic generations.",
)
logger.info(
f"Automatic generation enabled, will send messages every {self.s.automatic_generation_timer} seconds"
)
t = LoopingTimer(
self.s.automatic_generation_timer,
self._command_automatic_generation,