1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-28 01:33:10 +00:00

Bot: Added (*RawArguments).After

This commit is contained in:
diamondburned (Forefront) 2020-01-25 13:43:25 -08:00
parent bdcc863d45
commit 0c8c43d3f5

View file

@ -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