fix without mention becuase FUKIN DISCORD

This commit is contained in:
Adam R Grey 2023-05-07 00:37:22 -04:00
parent 78639f449c
commit 12e21e8ad7
2 changed files with 4 additions and 4 deletions

View File

@ -152,9 +152,9 @@ namespace silverworker_discord
Console.Error.WriteLine($"convert failed :( qr{todaysnumber}"); Console.Error.WriteLine($"convert failed :( qr{todaysnumber}");
} }
} }
public static async void Convert(SocketUserMessage message) public static async void Convert(SocketUserMessage message, string contentWithoutMention)
{ {
await message.Channel.SendMessageAsync(Conversion.Converter.convert(message.Content)); await message.Channel.SendMessageAsync(Conversion.Converter.convert(contentWithoutMention));
} }
public static async void Joke(SocketUserMessage message) public static async void Joke(SocketUserMessage message)
{ {

View File

@ -107,7 +107,7 @@ namespace silverworker_discord
var mentionedMe = false; var mentionedMe = false;
if (message.MentionedUsers?.FirstOrDefault(muid => muid.Id == _client.CurrentUser.Id) != null) if (message.MentionedUsers?.FirstOrDefault(muid => muid.Id == _client.CurrentUser.Id) != null)
{ {
var mentionOfMe = "<@!" + _client.CurrentUser.Id + ">"; var mentionOfMe = "<@" + _client.CurrentUser.Id + ">";
contentWithoutMention = message.Content.Replace(mentionOfMe + " ", null); contentWithoutMention = message.Content.Replace(mentionOfMe + " ", null);
contentWithoutMention = contentWithoutMention.Replace(mentionOfMe, null); contentWithoutMention = contentWithoutMention.Replace(mentionOfMe, null);
mentionedMe = true; mentionedMe = true;
@ -209,7 +209,7 @@ namespace silverworker_discord
} }
if (msgText.Contains("!freedomunits ")) if (msgText.Contains("!freedomunits "))
{ {
Features.Convert(message); Features.Convert(message, contentWithoutMention);
didThing = true; didThing = true;
} }
if (Regex.IsMatch(msgText, "!joke\\b")) if (Regex.IsMatch(msgText, "!joke\\b"))