feat: meeting room locking

This commit is contained in:
2026-03-17 17:11:22 +00:00
parent c4dd7302bc
commit 76aeca3de6
4 changed files with 278 additions and 1 deletions
+21
View File
@@ -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)
+4
View File
@@ -34,3 +34,7 @@ func (s *Service) IsTempChannel(ctx context.Context, guildID, channelID int64) (
return s.settings.IsMeetingTempChannel(ctx, guildID, channelID)
}
func (s *Service) GetTempChannelOwner(ctx context.Context, guildID, channelID int64) (createdBy int64, ok bool, err error) {
return s.settings.GetMeetingTempChannelOwner(ctx, guildID, channelID)
}