added more messages

This commit is contained in:
JkLondon
2025-08-01 01:49:03 +02:00
parent 5c56f44618
commit 93b673da43

16
main.go
View File

@ -63,6 +63,19 @@ func closeTask(taskID string) {
http.DefaultClient.Do(req)
}
func getRandomReminderMessage(task Task) string {
reminderMessages := []string{
"⏰ Ну что, сделал уже?! Задача: %s",
"⏰ Эй, не забыл про задачу? %s",
"⏰ Напоминаю о задаче: %s",
"⏰ Задача все еще ждет выполнения: %s",
"⏰ Пора бы уже сделать: %s",
}
randomIndex := time.Now().UnixNano() % int64(len(reminderMessages))
return fmt.Sprintf(reminderMessages[randomIndex], task.Content)
}
func spamCheck() {
tasks := getOverdueTasks()
for _, task := range tasks {
@ -77,7 +90,8 @@ func spamCheck() {
bot.Send(msg)
overdueTasks[task.ID] = true
} else {
bot.Send(tgbotapi.NewMessage(toInt64(chatID), "⏰ Ну что, сделал уже?!"))
reminderMessage := getRandomReminderMessage(task)
bot.Send(tgbotapi.NewMessage(toInt64(chatID), reminderMessage))
}
}
}