Slight changes
This commit is contained in:
parent
c78f98bf19
commit
32c14aecbc
@ -21,12 +21,14 @@ namespace NadekoBot.Modules.CustomReactions
|
|||||||
{
|
{
|
||||||
commandFuncs = new Dictionary<Regex, Func<CommandEventArgs, Match, string>>
|
commandFuncs = new Dictionary<Regex, Func<CommandEventArgs, Match, string>>
|
||||||
{
|
{
|
||||||
{new Regex(@"%rng(?:%|:(\d{0,9})-(\d{0,9})%)"), (e,m) => {
|
{new Regex(@"(?:%rng%|%rng:(\d{1,9})-(\d{1,9})%)"), (e,m) => {
|
||||||
int start, end;
|
int start, end;
|
||||||
if (int.TryParse(m.Groups[1].Value, out start) && int.TryParse(m.Groups[2].Value, out end)) {
|
if (m.Groups[1].Success)
|
||||||
|
{
|
||||||
|
start = int.Parse(m.Groups[1].Value);
|
||||||
|
end = int.Parse(m.Groups[2].Value);
|
||||||
return rng.Next(start, end).ToString();
|
return rng.Next(start, end).ToString();
|
||||||
}
|
}else return rng.Next().ToString();
|
||||||
else return rng.Next().ToString();
|
|
||||||
} },
|
} },
|
||||||
{new Regex("%mention%"), (e,m) => NadekoBot.BotMention },
|
{new Regex("%mention%"), (e,m) => NadekoBot.BotMention },
|
||||||
{new Regex("%user%"), (e,m) => e.User.Mention },
|
{new Regex("%user%"), (e,m) => e.User.Mention },
|
||||||
|
Loading…
Reference in New Issue
Block a user