fix regex to remove mentions

This commit is contained in:
Adam R Grey 2022-01-21 18:56:21 -05:00
parent fcf7d11715
commit 53c1d956b3

View File

@ -79,11 +79,10 @@ namespace silverworker_discord
{
if(message.Author.Id == 159985870458322944) //MEE6
{
var contentWithoutMnetion = Regex.Replace(message.Content, "<[^>]*>", "");
if(contentWithoutMnetion.Contains("you just advanced"))
if(message.Content?.Contains("you just advanced") == true)
{
var newText = Regex.Replace(message.Content, "<[^>]*>", message.Author.Username);
newText = Regex.Replace(message.Content, "level [\\d]+", "level -1");
newText = Regex.Replace(newText, "level [\\d]+", "level -1");
Features.mock(newText, message);
}
}