steamsalty/main.go
Noah Theus 1e94b1fc1e
Some checks failed
Build and Push to Docker Hub on push to any branch / docker (push) Has been cancelled
feat: Automatic comment translation using DeepL
2025-10-13 06:08:26 +02:00

45 lines
841 B
Go

package main
import (
"os"
"strconv"
"strings"
"time"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"watn3y/steamsalty/config"
deepl "watn3y/steamsalty/deepL"
)
func main() {
println("Starting SteamSalty...")
configureLogger()
config.LoadConfig()
if config.BotConfig.TranslateEnabled {
deepl.Init()
}
bot()
}
func configureLogger() {
zerolog.CallerMarshalFunc = func(pc uintptr, file string, line int) string {
const prefix = "steamsalty/"
index := strings.Index(file, prefix)
if index != -1 {
return file[index+len(prefix):] + ":" + strconv.Itoa(line)
}
return file + ":" + strconv.Itoa(line)
}
output := zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.DateTime}
log.Logger = zerolog.New(output).With().Timestamp().Caller().Logger()
log.Info().Msg("Logger started successfully")
}