From 0c8c43d3f56523740becbedcab0d5ea749469f11 Mon Sep 17 00:00:00 2001 From: "diamondburned (Forefront)" Date: Sat, 25 Jan 2020 13:43:25 -0800 Subject: [PATCH] Bot: Added (*RawArguments).After --- bot/arguments.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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