3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

plugins.censor: make token filter case-insensitive

This commit is contained in:
Miikka 2018-10-05 20:22:19 +03:00 committed by GitHub
parent e3ff4cef45
commit 6720a9a70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,7 +145,7 @@ export class CensorPlugin extends Plugin {
// Filter tokens
const blockedTokens = this.configValueForMsg(msg, "blocked_tokens") || [];
for (const token of blockedTokens) {
if (msg.content.includes(token)) {
if (msg.content.toLowerCase().includes(token.toLowerCase())) {
this.censorMessage(msg, `blocked token (\`${token}\`) found`);
return;
}