Dough Git

commit

Accept -g anywhere in d!autoproxy

commit
54debcd489b6d6f98440cf7d7d6fc0ea64068bd2
author
Clove Twilight <[email protected]>
date
2026-11-18 06:26
Co-Authored-By: Sandrone <[email protected]>

diff --git a/src/commands/autoproxy.ts b/src/commands/autoproxy.ts
index fe9e26d..f5b6f35 100644
--- a/src/commands/autoproxy.ts
+++ b/src/commands/autoproxy.ts
@@ -13,13 +13,14 @@ export async function autoproxyCommand(
     message: Message,
     args: string[],
 ): Promise<void> {
-    if (args[0] === "-g") {
-        await globalAutoproxy(message, args[1]);
+    // -g can go anywhere, so "-g on" and "on -g" both work
+    const [choice] = args.filter((arg) => arg !== "-g");
+
+    if (args.includes("-g")) {
+        await globalAutoproxy(message, choice);
         return;
     }
 
-    const [choice] = args;
-
     // Commands only run from server messages, so guildId is always set
     const autoproxy = guildSettings(message.guildId!).autoproxy;
     const current = autoproxy.enabled ? "on" : "off";