Merge branch 'features' of ALFRED/ALFRED into master
the build was successful Details

This commit is contained in:
Antoine Bartuccio 2018-07-24 18:11:59 +00:00 committed by Gitea
commit abaf36c6e3
1 changed files with 12 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* @Author: Bartuccio Antoine * @Author: Bartuccio Antoine
* @Date: 2018-07-24 14:55:33 * @Date: 2018-07-24 14:55:33
* @Last Modified by: klmp200 * @Last Modified by: klmp200
* @Last Modified time: 2018-07-24 17:50:19 * @Last Modified time: 2018-07-24 20:09:20
*/ */
package commands package commands
@ -38,11 +38,17 @@ func Gender(m *tb.Message) {
} }
func cleanGender(slice []string) []string { func cleanGender(slice []string) []string {
for i, value := range slice { for i := range slice {
if strings.HasPrefix(value, "@") { clean := false
slice[i] = strings.Replace(value, "@", "@ ", 1) for !clean {
} else if strings.HasPrefix(value, "/") { clean = true
slice[i] = strings.Replace(value, "/", "/ ", 1) if strings.HasPrefix(slice[i], "@") {
slice[i] = strings.Replace(slice[i], "@", "", 1)
clean = false
} else if strings.HasPrefix(slice[i], "/") {
slice[i] = strings.Replace(slice[i], "/", "", 1)
clean = false
}
} }
} }
return slice return slice