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;