feat: meeting room locking
This commit is contained in:
@@ -88,6 +88,27 @@ func (r *Repo) IsMeetingTempChannel(ctx context.Context, guildID, channelID int6
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Repo) GetMeetingTempChannelOwner(ctx context.Context, guildID, channelID int64) (createdBy int64, ok bool, err error) {
|
||||
const q = `
|
||||
SELECT created_by
|
||||
FROM meeting_temp_channels
|
||||
WHERE guild_id = $1 AND channel_id = $2
|
||||
`
|
||||
row := r.db.QueryRowContext(ctx, q, guildID, channelID)
|
||||
var cb sql.NullInt64
|
||||
switch err := row.Scan(&cb); err {
|
||||
case nil:
|
||||
if !cb.Valid {
|
||||
return 0, false, nil
|
||||
}
|
||||
return cb.Int64, true, nil
|
||||
case sql.ErrNoRows:
|
||||
return 0, false, nil
|
||||
default:
|
||||
return 0, false, err
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Repo) SetLevelSystemEnabled(ctx context.Context, guildID int64, enabled bool) error {
|
||||
const q = `
|
||||
INSERT INTO levelsettings (guild_id, levelsys)
|
||||
|
||||
Reference in New Issue
Block a user