Browse Source

Fixed commands with .AnyArgs() set

tags/docs-0.9
Googie2149 RogueException 9 years ago
parent
commit
89eb8f168b
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      src/Discord.Net.Commands/CommandsPlugin.cs

+ 9
- 3
src/Discord.Net.Commands/CommandsPlugin.cs View File

@@ -145,9 +145,15 @@ namespace Discord.Commands
for (int j = 0; j < newArgs.Length; j++)
newArgs[j] = args[j].Value;
}
else if (comm.MaxArgs == null && comm.MinArgs == null)
{
newArgs = new string[argCount];
for (int j = 0; j < newArgs.Length; j++)
newArgs[j] = args[j].Value;
}

// Check permissions here
int permissions = _getPermissions != null ? _getPermissions(e.Message.User) : 0;
// Check permissions here
int permissions = _getPermissions != null ? _getPermissions(e.Message.User) : 0;
var eventArgs = new CommandEventArgs(e.Message, comm, msg, cmd, argText, permissions, newArgs);
if (permissions < comm.MinPerms)
{
@@ -182,7 +188,7 @@ namespace Discord.Commands
CommandEventArgs eventArgs = new CommandEventArgs(e.Message, null, msg, cmd, null, null, null);
RaiseUnknownCommand(eventArgs);
if (builtInHelp)
await Reply(eventArgs, $"Command `cmd` does not exist.");
await Reply(eventArgs, $"The command `{cmd}` does not exist.");
return;
}
};


Loading…
Cancel
Save