Skip to content

Commit 340881b

Browse files
authored
Support multi-character bot prefixes (#144)
2 parents 117bac3 + 94abe45 commit 340881b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/events/messageCreate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export async function handleMessageCreate(
1818
) return;
1919

2020
// Split command and arguments
21-
const args = message.content.slice(1).trim().split(/ +/);
21+
const args = message.content.slice(config.prefix!.length).trim().split(/ +/);
2222

2323
// If no command provided, ignore
2424
if (args.length === 0) {
@@ -41,4 +41,4 @@ export async function handleMessageCreate(
4141
await message.react('❌');
4242
await message.reply(`❌ **Error**: Unknown command. Use \`${config.prefix}help\` to see available commands.`);
4343
}
44-
}
44+
}

0 commit comments

Comments
 (0)