mirror of
https://git.klmp200.net/ALFRED/ALFRED.git
synced 2025-01-18 10:36:44 +01:00
Merge branch 'features' of ALFRED/ALFRED into master
This commit is contained in:
commit
4a1a904d65
@ -2,7 +2,7 @@
|
||||
* @Author: Bartuccio Antoine
|
||||
* @Date: 2018-07-24 14:55:33
|
||||
* @Last Modified by: klmp200
|
||||
* @Last Modified time: 2018-07-24 20:09:20
|
||||
* @Last Modified time: 2018-07-24 20:29:36
|
||||
*/
|
||||
|
||||
package commands
|
||||
@ -29,11 +29,24 @@ func SetGender(m *tb.Message) {
|
||||
}
|
||||
|
||||
func Gender(m *tb.Message) {
|
||||
data, exists := shared.Users.Get(m.Sender.Username, "gender")
|
||||
if !exists {
|
||||
shared.Bot.Send(m.Chat, "Vous n'avez pas enregistré votre genre, je ne voudrais pas l'assumer.")
|
||||
split := strings.Split(m.Text, " ")
|
||||
if len(split) > 1 {
|
||||
// Username asked
|
||||
username := split[1]
|
||||
username = strings.Replace(username, "@", "", 1)
|
||||
data, exists := shared.Users.Get(username, "gender")
|
||||
if !exists {
|
||||
shared.Bot.Send(m.Chat, username+" n'est pas un utilisateur existant ou n'a pas renseigné son genre.")
|
||||
return
|
||||
}
|
||||
shared.Bot.Send(m.Chat, "L'utilisateur "+username+" a pour genre « "+data+" ».")
|
||||
} else {
|
||||
shared.Bot.Send(m.Chat, data)
|
||||
data, exists := shared.Users.Get(m.Sender.Username, "gender")
|
||||
if !exists {
|
||||
shared.Bot.Send(m.Chat, "Vous n'avez pas enregistré votre genre, je ne voudrais pas l'assumer.")
|
||||
} else {
|
||||
shared.Bot.Send(m.Chat, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user