fluxy-bot 0.15.8 → 0.15.10

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.15.8",
3
+ "version": "0.15.10",
4
4
  "releaseNotes": [
5
5
  "1. react router implemented",
6
6
  "2. new workspace design",
@@ -201,12 +201,25 @@ export class ChannelManager {
201
201
  return;
202
202
  }
203
203
 
204
- // ── Business mode: only respond to INCOMING messages (fromMe=false) ──
205
- // fromMe=true means either:
206
- // - Fluxy's own sent replies (would cause loops)
207
- // - User typing on Fluxy's WhatsApp Web (not intended for the bot)
208
- // Both should be ignored.
204
+ // ── Business mode ──
205
+ // fromMe=true + self-chat → admin talking to Fluxy
206
+ // fromMe=true + not self-chat user texting friends, ignore
207
+ // fromMe=false incoming message, resolve role
209
208
  if (fromMe) {
209
+ if (!isSelfChat) return; // ignore outgoing messages to other people
210
+
211
+ // Self-chat in business mode = admin
212
+ const message: InboundMessage = {
213
+ channel,
214
+ sender: sender.replace(/@.*/, ''),
215
+ senderName,
216
+ role: 'admin',
217
+ text,
218
+ rawSender: sender,
219
+ };
220
+
221
+ log.info(`[channels] Business mode | self-chat | admin | "${text.slice(0, 60)}"`);
222
+ await this.handleAdminMessage(message);
210
223
  return;
211
224
  }
212
225