diff --git a/types.go b/types.go index 5dce32c..c9b7a8f 100644 --- a/types.go +++ b/types.go @@ -167,8 +167,13 @@ func (m *Message) Command() string { if !m.IsCommand() { return "" } + command := strings.SplitN(m.Text, " ", 2)[0] - return strings.SplitN(m.Text, " ", 2)[0] + if i := strings.Index(command, "@"); i != -1 { + command = command[:i] + } + + return command } // CommandArguments checks if the message was a command and if it was,