Beta servers: testers can use beta features in servers whose owner opted in
- beta.Configure takes the opted-in servers; testers are looked up in the beta server - beta commands registered per opted-in server and removed when it opts out - beta.ServerEnabled for behaviour that no person triggers - docs updated Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
e2fe30b524
commit
fcf4f3ccbd
12 files changed
+491
-122
No files matched your search
@@ -422,3 +422,22 @@ func (r *Repo) GetBetaSettings(ctx context.Context) (guildID, roleID string, err
|
||||
}
|
||||
return guildID, roleID, nil
|
||||
}
|
||||
|
||||
// ListBetaGuilds returns the servers whose owner opted in to beta features
|
||||
// (set on the dashboard), as ID strings.
|
||||
func (r *Repo) ListBetaGuilds(ctx context.Context) ([]string, error) {
|
||||
rows, err := r.db.QueryContext(ctx, `SELECT guild_id FROM beta_guilds ORDER BY enabled_at`)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var out []string
|
||||
for rows.Next() {
|
||||
var id int64
|
||||
if err := rows.Scan(&id); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, strconv.FormatInt(id, 10))
|
||||
}
|
||||
return out, rows.Err()
|
||||
}
|
||||
Reference in new issue
Block a user