mirror of
https://git.klmp200.net/ALFRED/ALFRED.git
synced 2025-01-18 18:46:44 +01:00
Better word clean
This commit is contained in:
parent
3128e836ea
commit
504b8cb5e6
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user