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