- /meeting add-lobby, remove-lobby, lobbies: up to 10 lobbies per server, capped in the database - Deleted voice channels are dropped from the lobbies - Beta features: registered only in the beta server and usable only with the Beta Tester role (BETA_GUILD_ID, BETA_ROLE_ID); fails closed - /beta (bot owner only) shows how beta access is set up Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
55 lines
1.7 KiB
Go
55 lines
1.7 KiB
Go
package meeting
|
|
|
|
import (
|
|
"context"
|
|
|
|
"velox-bot/internal/db/repos/settingsrepo"
|
|
)
|
|
|
|
type Service struct {
|
|
settings *settingsrepo.Repo
|
|
}
|
|
|
|
func New(settings *settingsrepo.Repo) *Service {
|
|
return &Service{settings: settings}
|
|
}
|
|
|
|
// MaxLobbies is how many lobbies a server can have.
|
|
const MaxLobbies = settingsrepo.MaxMeetingLobbies
|
|
|
|
// ErrLobbyLimit means the server already has MaxLobbies.
|
|
var ErrLobbyLimit = settingsrepo.ErrMeetingLobbyLimit
|
|
|
|
func (s *Service) AddLobby(ctx context.Context, guildID, channelID int64) (added bool, err error) {
|
|
return s.settings.AddMeetingLobby(ctx, guildID, channelID)
|
|
}
|
|
|
|
func (s *Service) RemoveLobby(ctx context.Context, guildID, channelID int64) (removed bool, err error) {
|
|
return s.settings.RemoveMeetingLobby(ctx, guildID, channelID)
|
|
}
|
|
|
|
func (s *Service) ListLobbies(ctx context.Context, guildID int64) ([]int64, error) {
|
|
return s.settings.ListMeetingLobbies(ctx, guildID)
|
|
}
|
|
|
|
func (s *Service) IsLobby(ctx context.Context, guildID, channelID int64) (bool, error) {
|
|
return s.settings.IsMeetingLobby(ctx, guildID, channelID)
|
|
}
|
|
|
|
func (s *Service) AddTempChannel(ctx context.Context, guildID, channelID, createdBy int64) error {
|
|
return s.settings.AddMeetingTempChannel(ctx, guildID, channelID, createdBy)
|
|
}
|
|
|
|
func (s *Service) RemoveTempChannel(ctx context.Context, guildID, channelID int64) error {
|
|
return s.settings.RemoveMeetingTempChannel(ctx, guildID, channelID)
|
|
}
|
|
|
|
func (s *Service) IsTempChannel(ctx context.Context, guildID, channelID int64) (bool, error) {
|
|
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)
|
|
}
|
|
|