Skip to content

Commit

Permalink
优化 GetCommandArgs()
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianyiovo committed Feb 28, 2023
1 parent 2c6174b commit 6b033ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PrismBot.SDK/Extensions/MessageContextExtension.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Text.RegularExpressions;
using Sora.Entities;

namespace PrismBot.SDK.Extensions;
Expand All @@ -11,6 +12,6 @@ public static class MessageContextExtension
/// <returns></returns>
public static string[] GetCommandArgs(this MessageContext messageContext)
{
return messageContext.RawText.Trim().Split(" ");
return Regex.Replace(messageContext.RawText.Trim(), @"\s+", " ").Split(" ");
}
}

0 comments on commit 6b033ed

Please sign in to comment.