From 1b8a714a9620083e4b09d30bd7fa94a65c17a44b Mon Sep 17 00:00:00 2001 From: Adam R Grey Date: Sat, 13 Jul 2024 18:59:10 -0400 Subject: [PATCH] runs, performs features, doesn't crash --- Behavior/GeneralSnarkCloudNative.cs | 2 +- Behavior/GeneralSnarkMisspellDefinitely.cs | 2 +- Conversion/Converter.cs | 2 +- .../DiscordInterface/DiscordInterface.cs | 7 +++---- fail133653846161056785/error0.err | 15 +++++++++++++++ 5 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 fail133653846161056785/error0.err diff --git a/Behavior/GeneralSnarkCloudNative.cs b/Behavior/GeneralSnarkCloudNative.cs index 0eceb7b..90db765 100644 --- a/Behavior/GeneralSnarkCloudNative.cs +++ b/Behavior/GeneralSnarkCloudNative.cs @@ -22,7 +22,7 @@ public class GeneralSnarkCloudNative : Behavior if(Behaver.Instance.IsSelf(message.Author.Id)) return false; - if(message.Channel.EffectivePermissions.ReactionsPossible) + if(!message.Channel.EffectivePermissions.ReactionsPossible) return false; if((MeannessFilterLevel)message.Channel.EffectivePermissions.MeannessFilterLevel < MeannessFilterLevel.Medium) diff --git a/Behavior/GeneralSnarkMisspellDefinitely.cs b/Behavior/GeneralSnarkMisspellDefinitely.cs index 28425c2..0c32d6e 100644 --- a/Behavior/GeneralSnarkMisspellDefinitely.cs +++ b/Behavior/GeneralSnarkMisspellDefinitely.cs @@ -42,7 +42,7 @@ public class GeneralSnarkMisspellDefinitely : Behavior foreach(var k in snarkmap.Keys) { - if( Regex.IsMatch(message.Content, "\\b"+k+"\\b", RegexOptions.IgnoreCase)) + if( Regex.IsMatch(message.Content?.ToLower(), "\\b"+k+"\\b", RegexOptions.IgnoreCase)) return true; } return false; diff --git a/Conversion/Converter.cs b/Conversion/Converter.cs index b3b0ec3..e18d377 100644 --- a/Conversion/Converter.cs +++ b/Conversion/Converter.cs @@ -112,7 +112,7 @@ namespace vassago.Conversion accumulator = reverseConversion.Item4(accumulator); } } - if (normalizedDestUnit == currencyConf.Base || currencyConf.rates.Select(r => r.Key).Contains(normalizedDestUnit)) + if (currencyConf != null && (normalizedDestUnit == currencyConf.Base || currencyConf.rates.Select(r => r.Key).Contains(normalizedDestUnit))) { return $"{String.Format("approximately {0:0.00}", accumulator)} {normalizedDestUnit} as of {currencyConf.DateUpdated.ToLongDateString()}"; } diff --git a/ProtocolInterfaces/DiscordInterface/DiscordInterface.cs b/ProtocolInterfaces/DiscordInterface/DiscordInterface.cs index 38031ed..6234548 100644 --- a/ProtocolInterfaces/DiscordInterface/DiscordInterface.cs +++ b/ProtocolInterfaces/DiscordInterface/DiscordInterface.cs @@ -138,10 +138,9 @@ public class DiscordInterface var mentionOfMe = "<@" + client.CurrentUser.Id + ">"; m.MentionsMe = true; } - if (await Behaver.Instance.ActOn(m)) - { - m.ActedOn = true; - } + await Behaver.Instance.ActOn(m); + m.ActedOn = true; // for its own ruposess it might act on it later, but either way, fuck it, we checked. + _db.SaveChanges(); } diff --git a/fail133653846161056785/error0.err b/fail133653846161056785/error0.err new file mode 100644 index 0000000..6750c36 --- /dev/null +++ b/fail133653846161056785/error0.err @@ -0,0 +1,15 @@ +{ + "ClassName": "System.ComponentModel.Win32Exception", + "Message": "An error occurred trying to start process 'convert' with working directory '/home/adam/Desktop/vassago'. No such file or directory", + "Data": null, + "InnerException": null, + "HelpURL": null, + "StackTraceString": " at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)\n at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)\n at vassago.ExternalProcess.GoPlz(String commandPath, String commandArguments) in /home/adam/Desktop/vassago/externalProcess.cs:line 30", + "RemoteStackTraceString": null, + "RemoteStackIndex": 0, + "ExceptionMethod": null, + "HResult": -2147467259, + "Source": "System.Diagnostics.Process", + "WatsonBuckets": null, + "NativeErrorCode": 2 +} \ No newline at end of file