fix !pm send parsing
This commit is contained in:
@@ -10,12 +10,12 @@ var ErrInvalidArgs = fmt.Errorf("invalid arguments")
|
|||||||
|
|
||||||
// ParseSend parses "!pm send" command, returns to, subject, body, err
|
// ParseSend parses "!pm send" command, returns to, subject, body, err
|
||||||
func ParseSend(commandSlice []string) (string, string, string, error) {
|
func ParseSend(commandSlice []string) (string, string, string, error) {
|
||||||
if len(commandSlice) < 3 {
|
message := strings.Join(commandSlice, " ")
|
||||||
|
lines := strings.Split(message, "\n")
|
||||||
|
if len(lines) < 3 {
|
||||||
return "", "", "", ErrInvalidArgs
|
return "", "", "", ErrInvalidArgs
|
||||||
}
|
}
|
||||||
|
|
||||||
message := strings.Join(commandSlice, " ")
|
|
||||||
lines := strings.Split(message, "\n")
|
|
||||||
commandSlice = strings.Split(lines[0], " ")
|
commandSlice = strings.Split(lines[0], " ")
|
||||||
to := commandSlice[1]
|
to := commandSlice[1]
|
||||||
subject := lines[1]
|
subject := lines[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user