diff --git a/mods/remind.go b/mods/remind.go index 456e19f..f2c687e 100644 --- a/mods/remind.go +++ b/mods/remind.go @@ -105,6 +105,23 @@ func remind_message(broker *tg.Broker, update tg.APIMessage) { whentime := "alle " + timestamp.Format("15:04:05") broker.SendTextMessage(update.Chat, "Ok, vedrĂ² di avvisarti "+whenday+" "+whentime, &update.MessageID) } + + if isCommand(update, "reminders") { + // Should only work in private chats + if update.Chat.Type != tg.ChatTypePrivate { + broker.SendTextMessage(update.Chat, "Per favore chiedimi in privato dei reminder", &update.MessageID) + return + } + + useritems := []Reminder{} + for _, reminder := range reminders { + if reminder.TargetID == update.User.UserID { + useritems = append(useritems, reminder) + } + } + + broker.SendTextMessage(update.Chat, fmt.Sprintf("Ci sono %d reminder in coda per te", len(useritems)), &update.MessageID) + } } func runreminder(id string) {