feat: export guilds from old bot and import into new one
This commit is contained in:
parent
301744dd4e
commit
9302ba200f
10 changed files with 1326 additions and 0 deletions
27
go-exporter/main.go
Normal file
27
go-exporter/main.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
)
|
||||
|
||||
var conn *pgxpool.Pool
|
||||
var ctx = context.Background()
|
||||
|
||||
func main() {
|
||||
dsn := os.Getenv("DATABASE_URL")
|
||||
|
||||
pool, err := pgxpool.Connect(ctx, dsn)
|
||||
if err != nil {
|
||||
log.Fatalf("error connecting to db: %v\n", err)
|
||||
}
|
||||
conn = pool
|
||||
|
||||
err = exportGuilds()
|
||||
if err != nil {
|
||||
log.Fatalf("error exporting guilds: %v\n", err)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue