We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8bb6057 commit 91f16e8Copy full SHA for 91f16e8
apps/website/docs/guide/02-commands/04-message-commands.mdx
@@ -98,8 +98,17 @@ import { commandkit } from 'commandkit';
98
import { database } from '../database'; // This is a mock database
99
100
commandkit.setPrefixResolver(async (message) => {
101
+ if (!message.guildId) {
102
+ return '!'; // Fallback to '!' if command is used in a DM
103
+ }
104
+
105
const guildSettings = await database.findUnique({
- where: { guildId },
106
+ where: {
107
+ guildId: message.guildId,
108
+ },
109
+ select: {
110
+ prefix: true,
111
112
});
113
114
return guildSettings?.prefix ?? '!'; // Fallback to '!' if no prefix is found
0 commit comments