Keep track of guild states.

We don't currently bridge anything, but this just keeps everything in sync
with the discord server.
This commit is contained in:
Gary Kramlich
2022-03-29 07:10:16 -05:00
parent d4355779a6
commit 928a49b42d
7 changed files with 295 additions and 8 deletions

View File

@@ -23,6 +23,7 @@ type Database struct {
Reaction *ReactionQuery
Attachment *AttachmentQuery
Emoji *EmojiQuery
Guild *GuildQuery
}
func New(dbType, uri string, maxOpenConns, maxIdleConns int, baseLog log.Logger) (*Database, error) {
@@ -85,5 +86,10 @@ func New(dbType, uri string, maxOpenConns, maxIdleConns int, baseLog log.Logger)
log: db.log.Sub("Emoji"),
}
db.Guild = &GuildQuery{
db: db,
log: db.log.Sub("Guild"),
}
return db, nil
}