From c0143707e9fb843070fee73491a93d13cb8f6777 Mon Sep 17 00:00:00 2001 From: nefrace Date: Tue, 24 Jan 2023 03:10:57 +0300 Subject: [PATCH] Changed Param method of Command --- command.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/command.go b/command.go index f52d490..ff0a0ae 100644 --- a/command.go +++ b/command.go @@ -26,7 +26,11 @@ func (c *Command) 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 {