move stat to 23:00
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-04-06 17:56:04 +07:00
parent 64345c9350
commit 4ceb63a307
2 changed files with 7 additions and 12 deletions
+5 -5
View File
@@ -28,7 +28,7 @@ var (
)
const (
version = "v1.6.1"
version = "v1.6.2"
)
type Opts struct {
@@ -132,7 +132,7 @@ func run() {
return
}
for _, chatID := range chats {
if err := sendStatToChat(bot, dataBase, chatID, "Напоминаю:\n- Cегодня больше не жрем!\n\n", true); err != nil {
if err := sendStatToChat(bot, dataBase, chatID, "Напоминаю:\n- Cегодня больше не жрем!\n\n"); err != nil {
fmt.Println(err)
w.Header().Add("Content-Type", "application/json")
w.WriteHeader(http.StatusInternalServerError)
@@ -266,7 +266,7 @@ func run() {
case commands.Go:
sendGoToChat(bot, dataBase, chatID)
case commands.Stat:
if err := sendStatToChat(bot, dataBase, chatID, "", false); err != nil {
if err := sendStatToChat(bot, dataBase, chatID, ""); err != nil {
fmt.Println(err)
continue
}
@@ -312,8 +312,8 @@ func sendGoToChat(bot *tgbot.BotAPI, dataBase *db.DB, chatID int64) {
}
}
func sendStatToChat(bot *tgbot.BotAPI, dataBase *db.DB, chatID int64, prefix string, cron bool) error {
stat, err := dataBase.GetStat(chatID, cron)
func sendStatToChat(bot *tgbot.BotAPI, dataBase *db.DB, chatID int64, prefix string) error {
stat, err := dataBase.GetStat(chatID)
if err != nil {
return err
}