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

@ -3,14 +3,16 @@ package gaypoints
import (
"strconv"
"strings"
"watn3y/bloaterbot/botIO"
"watn3y/bloaterbot/commonlogic"
"watn3y/bloaterbot/config"
"watn3y.de/bloaterbot/botIO"
"watn3y.de/bloaterbot/commonlogic"
"watn3y.de/bloaterbot/config"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/rs/zerolog/log"
)
//TODO logging
// TODO logging
func GetGP(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
log.Debug().Int64("chat", update.Message.Chat.ID).Int64("user", update.Message.From.ID).Msg("getting gaypoints")
@ -97,7 +99,7 @@ func SetGP(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
log.Debug().Int64("chat", update.Message.Chat.ID).Ints64("enabledChats", config.BotConfig.GayPoints.ModifyUsers).Msg("not setting gaypoints, user not authorised")
sticker := tgbotapi.StickerConfig{BaseFile: tgbotapi.BaseFile{
BaseChat: tgbotapi.BaseChat{ChatID: update.Message.Chat.ID, ReplyToMessageID: update.Message.MessageID},
File: tgbotapi.FilePath("bloater.webp"),
File: tgbotapi.FilePath("data/bloater.webp"),
}}
botIO.SendSticker(sticker, bot)

View file

@ -2,7 +2,7 @@ package gaypoints
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
_ "modernc.org/sqlite"
"github.com/rs/zerolog/log"
)
@ -68,9 +68,9 @@ func sqlSetGP(chatid int64, userid int64, gaypoints int64) {
}
func InitDB() {
const dbPath string = "./bloater.db"
const dbPath string = "data/db/gaypoints.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")
}