|
@@ -49,6 +49,7 @@ type Handler func(*discordgo.Session, *discordgo.Message, *Context)
|
|
|
// This way processing some of this only needs to happen once.
|
|
|
type Context struct {
|
|
|
Fields []string
|
|
|
+ Args []string
|
|
|
Content string
|
|
|
isDirectMessage bool // Indicates the message was sent via direct message
|
|
|
Method Method
|
|
@@ -166,13 +167,13 @@ func isValidRouteType(routeType RouteType) bool {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
-func (r *Router) findRoute(searchString string, routeType RouteType) (*route, []string) {
|
|
|
+func (r *Router) findRoute(searchString string, routeType RouteType) (*route, []string, []string) {
|
|
|
logrus.Printf("Find Route: %s", searchString)
|
|
|
fields := strings.Fields(searchString)
|
|
|
|
|
|
if len(fields) == 0 {
|
|
|
logrus.Printf("No route Found")
|
|
|
- return nil, nil
|
|
|
+ return nil, nil, nil
|
|
|
}
|
|
|
|
|
|
commandKey := fields[0]
|
|
@@ -184,9 +185,9 @@ func (r *Router) findRoute(searchString string, routeType RouteType) (*route, []
|
|
|
|
|
|
if strings.ToLower(commandKey) == strings.ToLower(route.Name) {
|
|
|
logrus.Printf("Route Found: %s", route.Name)
|
|
|
- return route, fields[0:]
|
|
|
+ return route, fields[0:], fields[1:]
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return nil, nil
|
|
|
+ return nil, nil, nil
|
|
|
}
|