mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-03-23 10:29:30 +00:00
ManualParser commands can now have no arguments
This commit is contained in:
parent
0304ffaeb0
commit
95b6a1c0c9
|
@ -221,16 +221,6 @@ func (ctx *Context) callMessageCreate(mc *gateway.MessageCreateEvent) error {
|
||||||
|
|
||||||
// Check manual parser
|
// Check manual parser
|
||||||
if cmd.Arguments[0].fn == nil {
|
if cmd.Arguments[0].fn == nil {
|
||||||
if len(args[start:]) == 0 {
|
|
||||||
return &ErrInvalidUsage{
|
|
||||||
Args: args,
|
|
||||||
Prefix: ctx.Prefix,
|
|
||||||
Index: len(args) - start,
|
|
||||||
Err: "Not enough arguments given",
|
|
||||||
Ctx: cmd,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a zero value instance of this:
|
// Create a zero value instance of this:
|
||||||
v := reflect.New(cmd.Arguments[0].Type)
|
v := reflect.New(cmd.Arguments[0].Type)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue