forked from git.klmp200.net/ALFRED
Merge branch 'features' of ALFRED/ALFRED into master
This commit is contained in:
commit
abaf36c6e3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user