brainiac-discord 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/brainiac/plugins/discord/message.rb +15 -4
- data/lib/brainiac/plugins/discord/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c28ec3344ab8f68efb007fc26d1cf8313427b74bc9e0b4db4f8bd82eddd403d8
|
|
4
|
+
data.tar.gz: c86021ac1c0145cef864bd59f79e43edde8ba2645a4a2d31cd409570c3f935a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 26f16e31243fefadb58e7c77c7dcb1cd835c9e674ebbaf0766b3feece5f5cfc4a6262b3a0c3a2281b63f30fc20d8dbc9a51daa806f4a044e2be8c6df6c1e6d39
|
|
7
|
+
data.tar.gz: dc8afd82dd157ec2f4c5c81e4bf3fd90b18bfd6dee1b568598eb1245a109a7ccb8aef20b79ae6329f34f2ac704c7cd185d3e56082aa3c08297929eab8820e799
|
|
@@ -101,9 +101,9 @@ module Brainiac
|
|
|
101
101
|
content.match?(/<@&#{Regexp.escape(role_id)}>/)
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
# Check if another agent bot is explicitly mentioned
|
|
105
|
-
# When a user @mentions
|
|
106
|
-
# mentioned should stay silent — no intent check needed.
|
|
104
|
+
# Check if another agent bot or a known human user is explicitly mentioned
|
|
105
|
+
# in this message. When a user @mentions someone specific, thread participants
|
|
106
|
+
# who weren't mentioned should stay silent — no intent check needed.
|
|
107
107
|
def other_agent_mentioned?(mentions, content, agent_key)
|
|
108
108
|
mention_roles = []
|
|
109
109
|
|
|
@@ -118,7 +118,18 @@ module Brainiac
|
|
|
118
118
|
mention_roles << role_id if role_id
|
|
119
119
|
end
|
|
120
120
|
|
|
121
|
-
mention_roles.any? { |rid| content.match?(/<@&#{Regexp.escape(rid)}>/) }
|
|
121
|
+
return true if mention_roles.any? { |rid| content.match?(/<@&#{Regexp.escape(rid)}>/) }
|
|
122
|
+
|
|
123
|
+
# Also check human user_mappings — if a human was explicitly @mentioned,
|
|
124
|
+
# thread participants should stand down (message directed at someone specific)
|
|
125
|
+
Config.user_mappings.each_value do |discord_id|
|
|
126
|
+
next unless discord_id
|
|
127
|
+
|
|
128
|
+
return true if mentions.any? { |m| m["id"].to_s == discord_id.to_s } ||
|
|
129
|
+
content.match?(/<@!?#{Regexp.escape(discord_id.to_s)}>/)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
false
|
|
122
133
|
end
|
|
123
134
|
|
|
124
135
|
def validate_cross_agent_dispatch(sender_agent_key, agent_key, mentioned, content, channel_id)
|