A bunch of Changes

Docker is broken as of now, will fix later
This commit is contained in:
watn3y 2023-12-29 05:15:23 +01:00
parent 1a6953900c
commit 6375fe5af1
27 changed files with 258 additions and 81 deletions

View file

@ -5,11 +5,13 @@ import (
"strconv"
"strings"
"time"
"watn3y/bloaterbot/botIO"
"watn3y.de/bloaterbot/botIO"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/rs/zerolog/log"
)
//TODO logging
func Reminder(update tgbotapi.Update, bot *tgbotapi.BotAPI) {

View file

@ -3,6 +3,7 @@ package notify
import (
"database/sql"
"github.com/rs/zerolog/log"
_ "modernc.org/sqlite"
)
var notifySetReminder *sql.Stmt
@ -12,9 +13,9 @@ var notifyDeleteReminder *sql.Stmt
//TODO logging
//TODO switch to SQL
func InitDB() {
const dbPath string = "./bloater.db"
const dbPath string = "data/db/notify.db"
log.Info().Str("dbpath", dbPath).Msg("init database")
db, err := sql.Open("sqlite3", dbPath)
db, err := sql.Open("sqlite", dbPath)
if err != nil {
log.Panic().Err(err).Msg("failed to open sqlite database")
}