From 098db2ca288cfbddb7283098132c38001e2f2413 Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Sun, 12 May 2024 12:03:02 +0700 Subject: [PATCH] feat: disable dm for slash --- src/lib/HootClient.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/HootClient.ts b/src/lib/HootClient.ts index 20c5d39..e739cba 100644 --- a/src/lib/HootClient.ts +++ b/src/lib/HootClient.ts @@ -21,6 +21,10 @@ export class HootClient extends SapphireClient { dev && ApplicationCommandRegistries.setDefaultGuildIds([process.env.DEV_GUILD_ID]); + for (const command of container.stores.get('commands').values()) { + command.applicationCommandRegistry.registerChatInputCommand((b) => b.setDMPermission(false)); + } + ApplicationCommandRegistries.registries.forEach((r) => r.registerChatInputCommand((b) => b.setDMPermission(false))); } }