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
|
@@ -201,12 +201,25 @@ export class ChannelManager {
|
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
// ── Business mode
|
|
205
|
-
// fromMe=true
|
|
206
|
-
//
|
|
207
|
-
//
|
|
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
|
|