diff --git a/src/providers/Discord.ts b/src/providers/Discord.ts index 8e23ed4..b74c505 100644 --- a/src/providers/Discord.ts +++ b/src/providers/Discord.ts @@ -116,13 +116,31 @@ class Discord { '!','@','#','$','%','^','&','*','(',')','-','=','_','+','\\','/','<','>','[',']','{','}','`','"',"'",',','.','~','|',';',':','?','、','。' ]; + const isTag = (prefix: string) => { + return prefix.startsWith('<@!') && prefix.endsWith('>') || + prefix.startsWith('<:') && prefix.endsWith('>') || + prefix.startsWith('') || + prefix.startsWith('<#') && prefix.endsWith('>'); + } + if((GuildCache.prefix.indexOf(' ') >= 0)) { if(noPrefixMessage.charAt(0) !== ' ') return; } else { if(symbols.includes(GuildCache.prefix.charAt(GuildCache.prefix.length - 1))) { - if(noPrefixMessage.charAt(0) === ' ') return; + + if(noPrefixMessage.charAt(0) === ' ') { + //Handle for "@Bot " + if(isTag(GuildCache.prefix)) {} + else + return; + } + else { + //Handle for "@Bot" + if(isTag(GuildCache.prefix)) return; + } } + else { if(noPrefixMessage.charAt(0) !== ' ') return; }