feat: import messages from go version
This commit is contained in:
parent
b56a71e105
commit
a50a8567dd
15 changed files with 503 additions and 769 deletions
|
|
@ -4,14 +4,17 @@ import (
|
|||
"context"
|
||||
"log"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
)
|
||||
|
||||
var conn *pgxpool.Pool
|
||||
var ctx = context.Background()
|
||||
var aesKey [32]byte
|
||||
|
||||
func main() {
|
||||
copy(aesKey[:], []byte(os.Getenv("AES_KEY")))
|
||||
dsn := os.Getenv("DATABASE_URL")
|
||||
|
||||
pool, err := pgxpool.Connect(ctx, dsn)
|
||||
|
|
@ -24,4 +27,11 @@ func main() {
|
|||
if err != nil {
|
||||
log.Fatalf("error exporting guilds: %v\n", err)
|
||||
}
|
||||
|
||||
if ok, _ := strconv.ParseBool(os.Getenv("EXPORT_MESSAGES")); ok {
|
||||
err = exportMessages()
|
||||
if err != nil {
|
||||
log.Fatalf("error exporting messages: %v\n", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue