From e2ee46eba9d6cc19a4d267c820dcaebc5d8d7c5f Mon Sep 17 00:00:00 2001 From: jetsparrow Date: Sat, 9 Feb 2019 19:01:12 +0300 Subject: [PATCH] build project under dotnet framework for deploy on linux x86 --- JetKarmaBot/CommandRouter.cs | 6 +++--- JetKarmaBot/Commands/CommandString.cs | 4 ++-- JetKarmaBot/JetKarmaBot.csproj | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/JetKarmaBot/CommandRouter.cs b/JetKarmaBot/CommandRouter.cs index f65d5ee..668875c 100644 --- a/JetKarmaBot/CommandRouter.cs +++ b/JetKarmaBot/CommandRouter.cs @@ -76,10 +76,10 @@ namespace JetKarmaBot { build = build + "/" + names[i] + "\n"; } - build += "/" + names[names.Count - 1] + " " + string.Join(' ', c.Arguments.Select(x => (!x.Required ? "[" : "") + x.Name + (!x.Required ? "]" : ""))) + " " + getLocalizedCMDDesc(c, loc) + ""; + build += "/" + names[names.Count - 1] + " " + string.Join(" ", c.Arguments.Select(x => (!x.Required ? "[" : "") + x.Name + (!x.Required ? "]" : ""))) + " " + getLocalizedCMDDesc(c, loc) + ""; pieces.Add(build); } - return string.Join('\n', pieces); + return string.Join("\n", pieces); } internal string GetHelpTextFor(string commandname, Locale loc) @@ -91,7 +91,7 @@ namespace JetKarmaBot { build = build + "/" + names[i] + "\n"; } - build += "/" + names[names.Count - 1] + " " + string.Join(' ', c.Arguments.Select(x => (!x.Required ? "[" : "") + x.Name + (!x.Required ? "]" : ""))) + " " + getLocalizedCMDDesc(c, loc) + "\n"; + build += "/" + names[names.Count - 1] + " " + string.Join(" ", c.Arguments.Select(x => (!x.Required ? "[" : "") + x.Name + (!x.Required ? "]" : ""))) + " " + getLocalizedCMDDesc(c, loc) + "\n"; build += string.Join("\n", c.Arguments.Select(ca => (!ca.Required ? "[" : "") + ca.Name + (!ca.Required ? "]" : "") + ": " + getLocalizedCMDArgDesc(ca, loc) + "")); return build; } diff --git a/JetKarmaBot/Commands/CommandString.cs b/JetKarmaBot/Commands/CommandString.cs index fe8f304..5bf3448 100644 --- a/JetKarmaBot/Commands/CommandString.cs +++ b/JetKarmaBot/Commands/CommandString.cs @@ -36,8 +36,8 @@ namespace JetKarmaBot.Commands if (!match.Success) return false; - string cmd = match.Groups["cmd"].Captures.First().Value; - string username = match.Groups["name"].Captures.FirstOrDefault()?.Value; + string cmd = match.Groups["cmd"].Captures[0].Value; + string username = match.Groups["name"].Captures.Count > 0 ? match.Groups["name"].Captures[0].Value : null; string[] parameters = words.Skip(1).ToArray(); result = new CommandString(cmd, parameters) { UserName = username}; diff --git a/JetKarmaBot/JetKarmaBot.csproj b/JetKarmaBot/JetKarmaBot.csproj index 8641b19..9e57ac4 100644 --- a/JetKarmaBot/JetKarmaBot.csproj +++ b/JetKarmaBot/JetKarmaBot.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp2.1 + netcoreapp2.1;net47;