func (this *Chinese) Command(name string, msg telegram.TObject, args []string) { if name == "learn" { this.Learn(strings.Join(args, " "), msg.ChatId()) } else if name == "speak" { this.tg.SendMessage(this.Speak(msg.ChatId()), msg.ChatId()) } else if name == "answer" { text := strings.Join(args, " ") id := msg.MessageId() if (text == "") && (msg["reply_to_message"] != nil) && (msg.ReplyToMessage()["text"] != nil) { text = msg.ReplyToMessage()["text"].(string) id = msg.ReplyToMessage().MessageId() } text = strings.Trim(text, " \n") if text == "" { this.tg.ReplyToMessage(msg.MessageId(), "Please provide a question or reply to a message for me to answer.", msg.ChatId()) } else { r := this.Answer(text, msg.ChatId()) if r != "" { this.tg.ReplyToMessage(id, r, msg.ChatId()) } } } }