4141class AiCog (Cog , description = "Integrated generative AI chat bot" ):
4242 MAX_ACTORS = 10 # last interactors
4343 MAX_CHANNEL_HISTORY = 300 # last messages/participants
44+
4445 COOLDOWN_TIME = 60 # 1 min
4546 MAX_FILE_SIZE = 2097152 # 2 MB
4647 REPLY_DELAY_RANGE = (1 , 5 ) # 1 sec - 5 sec
48+
49+ AUTO_REPLY_ENABLED = False
4750 AUTO_REPLY_DELAY_RANGE = (5 , 1800 ) # 5 sec - 30 min
4851 AUTO_REPLY_CHANCE = 0.1 # 10 %
52+
53+ INITIATIVE_ENABLED = False
4954 INITIATIVE_DELAY_RANGE = (1800 , 7200 ) # 30 min - 2 hr
5055
5156 def __init__ (self , bot : ActBot ):
@@ -56,9 +61,11 @@ def __init__(self, bot: ActBot):
5661 instructions = self .persona .description ,
5762 )
5863 log .info (f"AI persona @{ self .persona .name } used." )
59- return # 🔴 INITIATIVE OFF
6064 self .task_manager = ActTaskManager ()
61- self .task_manager .schedule ("initiative" , lambda _ : self .schedule_initiative ())
65+ if self .INITIATIVE_ENABLED :
66+ self .task_manager .schedule (
67+ "initiative" , lambda _ : self .schedule_initiative ()
68+ )
6269
6370 def cog_unload (self ):
6471 self .task_manager .cancel_all ()
@@ -195,8 +202,7 @@ async def on_message(self, message: Message):
195202 # Ignore mentionless message or attempt auto-reply
196203 reply_delay = 0
197204 if self .bot .user not in message .mentions :
198- return # 🔴 AUTO-REPLY OFF
199- if random () > self .AUTO_REPLY_CHANCE :
205+ if not self .AUTO_REPLY_ENABLED or random () > self .AUTO_REPLY_CHANCE :
200206 return
201207 else :
202208 reply_delay = randint (
0 commit comments