forked from git.klmp200.net/ALFRED
31 lines
742 B
Go
31 lines
742 B
Go
/*
|
|
* @Author: Bartuccio Antoine
|
|
* @Date: 2018-07-24 14:55:33
|
|
* @Last Modified by: klmp200
|
|
* @Last Modified time: 2018-07-24 15:10:37
|
|
*/
|
|
|
|
package commands
|
|
|
|
import (
|
|
"../shared"
|
|
tb "gopkg.in/tucnak/telebot.v2"
|
|
"strings"
|
|
)
|
|
|
|
func SetGender(m *tb.Message) {
|
|
split := strings.Split(m.Text, " ")
|
|
data := strings.Join(split[1:], " ")
|
|
shared.Users.Set(m.Sender.ID, "gender", data)
|
|
shared.Bot.Send(m.Chat, "Votre genre est enregistré, je vous considère maintenant comme « "+data+" ».")
|
|
}
|
|
|
|
func Gender(m *tb.Message) {
|
|
data, exists := shared.Users.Get(m.Sender.ID, "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)
|
|
}
|
|
}
|