whatsapp-pi 1.0.8 → 1.0.9
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 +1 -1
- package/whatsapp-pi.ts +5 -5
package/package.json
CHANGED
package/whatsapp-pi.ts
CHANGED
|
@@ -38,7 +38,7 @@ export default function(pi: ExtensionAPI) {
|
|
|
38
38
|
// Initial status setup
|
|
39
39
|
pi.on("session_start", async (_event, ctx) => {
|
|
40
40
|
// Check verbose mode
|
|
41
|
-
const isVerboseFlagSet =
|
|
41
|
+
const isVerboseFlagSet = process.argv.includes("--verbose");
|
|
42
42
|
|
|
43
43
|
const isVerbose = isVerboseFlagSet;
|
|
44
44
|
|
|
@@ -68,7 +68,7 @@ export default function(pi: ExtensionAPI) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// Check whatsapp flag
|
|
71
|
-
const isConnectFlagSet =
|
|
71
|
+
const isConnectFlagSet = process.argv.includes("--whatsapp");
|
|
72
72
|
|
|
73
73
|
// Auto-connect removed to avoid socket conflicts
|
|
74
74
|
if (await sessionManager.isRegistered()) {
|
|
@@ -154,7 +154,7 @@ export default function(pi: ExtensionAPI) {
|
|
|
154
154
|
await lastCommandCtx.newSession();
|
|
155
155
|
} else {
|
|
156
156
|
// Trigger the internal reset command to get a CommandContext
|
|
157
|
-
pi.sendUserMessage("/
|
|
157
|
+
pi.sendUserMessage("/internal-reset", { deliverAs: "followUp" });
|
|
158
158
|
}
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
@@ -164,7 +164,7 @@ export default function(pi: ExtensionAPI) {
|
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
// Internal command to trigger a real new session when we don't have a lastCommandCtx
|
|
167
|
-
pi.registerCommand("
|
|
167
|
+
pi.registerCommand("internal-reset", {
|
|
168
168
|
description: "Internal WhatsApp session reset",
|
|
169
169
|
handler: async (_args, ctx) => {
|
|
170
170
|
lastCommandCtx = ctx;
|
|
@@ -180,7 +180,7 @@ export default function(pi: ExtensionAPI) {
|
|
|
180
180
|
if (lastCommandCtx) {
|
|
181
181
|
await lastCommandCtx.newSession();
|
|
182
182
|
} else {
|
|
183
|
-
pi.sendUserMessage("/
|
|
183
|
+
pi.sendUserMessage("/internal-reset", { deliverAs: "followUp" });
|
|
184
184
|
}
|
|
185
185
|
return { action: "handled" };
|
|
186
186
|
}
|