41 lines
1.2 KiB
Go
41 lines
1.2 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}
|
|
}
|
|
|
|
func (s *Service) SetLobbyChannel(ctx context.Context, guildID int64, lobbyChannelID int64) error {
|
|
return s.settings.SetMeetingLobbyChannel(ctx, guildID, lobbyChannelID)
|
|
}
|
|
|
|
func (s *Service) GetLobbyChannel(ctx context.Context, guildID int64) (channelID int64, ok bool, err error) {
|
|
return s.settings.GetMeetingLobbyChannel(ctx, guildID)
|
|
}
|
|
|
|
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)
|
|
}
|
|
|