Changed Param method of Command
This commit is contained in:
parent
d035524ebc
commit
c0143707e9
|
@ -26,7 +26,11 @@ func (c *Command) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Command) Param(text string) string {
|
func (c *Command) Param(text string) string {
|
||||||
return strings.TrimPrefix(text, "/"+c.Body+" ")
|
strs := strings.SplitN(text, " ", 2)
|
||||||
|
if len(strs) > 1 {
|
||||||
|
return strs[1]
|
||||||
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func MakeCommandList(format string, commands ...*Command) string {
|
func MakeCommandList(format string, commands ...*Command) string {
|
||||||
|
|
Loading…
Reference in New Issue