Allow for case-insensitive HasStringPrefix (#644)
This was 👍'd in the dev chat, I forgot to make a PR for it (whoops!)
This commit is contained in:
committed by
RogueException
parent
82a413ace6
commit
112a434424
@@ -1,4 +1,6 @@
|
||||
namespace Discord.Commands
|
||||
using System;
|
||||
|
||||
namespace Discord.Commands
|
||||
{
|
||||
public static class MessageExtensions
|
||||
{
|
||||
@@ -12,10 +14,10 @@
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static bool HasStringPrefix(this IUserMessage msg, string str, ref int argPos)
|
||||
public static bool HasStringPrefix(this IUserMessage msg, string str, ref int argPos, StringComparison comparisonType = StringComparison.Ordinal)
|
||||
{
|
||||
var text = msg.Content;
|
||||
if (text.StartsWith(str))
|
||||
if (text.StartsWith(str, comparisonType))
|
||||
{
|
||||
argPos = str.Length;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user