fix: address review feedback for proactive reply logic
- Parse display names with ': ' split to handle colons in names - Reset cooldown to half instead of subtract-3 to reduce LLM call frequency - Remove redundant message.guild check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
10
cogs/chat.py
10
cogs/chat.py
@@ -250,8 +250,8 @@ class ChatCog(commands.Cog):
|
||||
memory_parts = []
|
||||
seen_users = set()
|
||||
for line in recent_for_check:
|
||||
name = line.split(":")[0]
|
||||
if name not in seen_users and message.guild:
|
||||
name = line.split(": ", 1)[0]
|
||||
if name not in seen_users:
|
||||
seen_users.add(name)
|
||||
member = discord.utils.find(
|
||||
lambda m, n=name: m.display_name == n,
|
||||
@@ -274,10 +274,8 @@ class ChatCog(commands.Cog):
|
||||
should_reply = True
|
||||
is_proactive = True
|
||||
else:
|
||||
# Not relevant — partially reset cooldown so we check again sooner
|
||||
self._messages_since_reply[ch_id] = max(
|
||||
0, self._messages_since_reply[ch_id] - 3
|
||||
)
|
||||
# Not relevant — reset to half cooldown so we wait a bit before rechecking
|
||||
self._messages_since_reply[ch_id] = cooldown // 2
|
||||
|
||||
if not should_reply:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user