Skip to content

Commit

Permalink
fix: cannot handle Upper case name (quite silly)
Browse files Browse the repository at this point in the history
Co-authored-by: wyssicky25 <wyssicky@gmail.com>
  • Loading branch information
RainyXeon and wyssicky25 committed Jan 1, 2025
1 parent 8a254ee commit ab88b9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/events/guild/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class {
return
}
const escapeRegex = (str: string) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
const prefixRegex = new RegExp(`^(<@!?${client.user!.id}>|${escapeRegex(PREFIX)})\\s*`)
const prefixRegex = new RegExp(`^(<@!?${client.user!.id}>|${escapeRegex(PREFIX.toLowerCase())})\\s*`, 'i')
if (!prefixRegex.test(message.content)) return
const [matchedPrefix] = message.content.match(prefixRegex) as RegExpMatchArray
const args = message.content.slice(matchedPrefix.length).trim().split(/ +/g)
Expand Down

0 comments on commit ab88b9f

Please sign in to comment.