Skip to content

Commit

Permalink
fix: 🐛 fix messages not being detected due to case
Browse files Browse the repository at this point in the history
  • Loading branch information
konhi committed Jan 8, 2022
1 parent d88bc3b commit f067c8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const config = {
],
forbiddenMessages: [
'nitro',
'steam store'
'steam store',
'open the link'
]
}
2 changes: 1 addition & 1 deletion src/listeners/ScamMessageListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const log = createLogger()
export default class ScamMessageListener implements DiscordListener {
registerListener (client: Discord.Client): void {
client.on('messageCreate', async (message) => {
if (this.hasForbiddenWords(message.content)) {
if (this.hasForbiddenWords(message.content.toLowerCase())) {
log.info(`Removed ${message.author.id}: ${message.content}`)
message.delete()
}
Expand Down

0 comments on commit f067c8a

Please sign in to comment.