// ParseCommandForBot gots input of type "Bot, /help smth" (comma after bot name can be omitted) and returns a command
ParseCommandForBot gots input of type "Bot, /help smth" (comma after bot name can be omitted) and returns a command
// ParseCommandForBot gots input of type " Bot / help smth " ( comma after bot name can be omitted ) and returns a command
func ParseCommandForBot(botname string, msg *models.Message) (Command, error) {
	if len(msg.Text) == 0 || msg.UserName == botname {
		return nil, ErrBadInput
	}
	splitted := strings.SplitN(msg.Text, " ", 2)
	if len(splitted) < 2 || !(splitted[0] == botname+"," || splitted[0] == botname) {
		return nil, ErrBadInput
	}
	cmd := splitted[1]
	arg := ""
	return getCommand(cmd, arg)
}
func ParseCommandForBot ( botname string , msg * models . Message ) ( Command , error ) { if len ( msg . Text ) == 0 || msg . UserName == botname { return nil , ErrBadInput } splitted := strings . SplitN ( msg . Text , " " , 2 ) if len ( splitted ) < 2 || ! ( splitted [ 0 ] == botname + " " || splitted [ 0 ] == botname ) { return nil , ErrBadInput } cmd := splitted [ 1 ] arg := " " return getCommand ( cmd , arg ) }
ParseCommandForBot gots input of type "Bot, /help smth" (comma after bot name can be omitted) and returns a command
ParseCommandForBot gots input of type " Bot / help smth " ( comma after bot name can be omitted ) and returns a command