Dont parse message author if it starts with a mention

This commit is contained in:
Jeremy Zhang 2019-02-01 17:28:56 +00:00
parent 8c8e3cd3ab
commit eda98c6339

View File

@ -1169,7 +1169,7 @@
} }
function format_bot_message(message) { function format_bot_message(message) {
if (message.author.id == bot_client_id && (message.content.includes("**") && ( (message.content.includes("<")&&message.content.includes(">")) || (message.content.includes("[") && message.content.includes("]")) ))) { if (message.author.id == bot_client_id && (message.content.includes("**") && ( (message.content.includes("<")&&message.content.includes(">")&&!message.content.startsWith("<@")) || (message.content.includes("[") && message.content.includes("]")) ))) {
var usernamefield = message.content.substring(getPosition(message.content, "**", 1)+3, getPosition(message.content, "**", 2)-1); var usernamefield = message.content.substring(getPosition(message.content, "**", 1)+3, getPosition(message.content, "**", 2)-1);
if (message.content.startsWith("(Titan Dev) ")) { if (message.content.startsWith("(Titan Dev) ")) {
message.content = message.content.substring(usernamefield.length + 18); message.content = message.content.substring(usernamefield.length + 18);