Added a length fix, and adjusted sleep timer.

This commit is contained in:
Dani 2025-04-14 20:08:59 -04:00
parent ed5297e896
commit 4691c84348

View File

@ -61,7 +61,8 @@ class Ruby(discord.Client):
speak = random() < 0.5 speak = random() < 0.5
thought = self.trainer.daydream(say_thought=speak) thought = self.trainer.daydream(say_thought=speak)
if speak and thought: if speak and thought and
len(thought.split()) >=4:
for guild in self.guilds: for guild in self.guilds:
for channel in guild.text_channels: for channel in guild.text_channels:
if channel.permissions_for(guild.me).send_messages: if channel.permissions_for(guild.me).send_messages:
@ -72,7 +73,7 @@ class Ruby(discord.Client):
await self.set_activity(None) # reset to normal await self.set_activity(None) # reset to normal
self.last_message_time = datetime.utcnow() self.last_message_time = datetime.utcnow()
await asyncio.sleep(30) await asyncio.sleep(180)
async def on_message(self, message: discord.Message): async def on_message(self, message: discord.Message):
if message.author.id == self.user.id: if message.author.id == self.user.id: