diff --git a/bot/arguments.go b/bot/arguments.go index 4125c6a..ef8d6dd 100644 --- a/bot/arguments.go +++ b/bot/arguments.go @@ -49,10 +49,22 @@ func (r *RawArguments) Arg(n int) string { return r.Arguments[n] } +func (r *RawArguments) After(n int) string { + if n < 0 || n >= len(r.Arguments) { + return "" + } + + return strings.Join(r.Arguments[n:], " ") +} + func (r *RawArguments) String() string { return r.Command + " " + strings.Join(r.Arguments, " ") } +func (r *RawArguments) Length() int { + return len(r.Arguments) +} + // Argument is each argument in a method. type Argument struct { String string