Documentation ¶
Index ¶
- Constants
- func AudioIDs() ([]string, error)
- func Duration(path string) (duration time.Duration, err error)
- func Path(id string) string
- func Play(ctx context.Context, vc *discordgo.VoiceConnection, path string, ...) (err error)
- func RandomAudioID() (string, error)
- type AudioQueryType
- type AudioSearchService
- type BotLocalStorage
- func (b BotLocalStorage) Active(_ context.Context) bool
- func (b BotLocalStorage) Add(ctx context.Context, file io.Reader, id, name string) (string, error)
- func (b BotLocalStorage) AudioFileInfo(ctx context.Context, params SearchParams, page uint) ([]api.AudioFileInfo, error)
- func (b BotLocalStorage) Get(ctx context.Context, params SearchParams) (path string, err error)
- func (b BotLocalStorage) Remove(ctx context.Context, params SearchParams) error
- type ChatHandler
- type ChatInfo
- type SearchParams
- type SpockVoiceChannels
Constants ¶
View Source
const (
CacheDirAudioKey = "CACHE_AUDIO_DIR"
)
Variables ¶
This section is empty.
Functions ¶
func RandomAudioID ¶
Types ¶
type AudioQueryType ¶
type AudioQueryType byte
const ( NameType AudioQueryType = 0x0 IDType AudioQueryType = 0x1 )
type AudioSearchService ¶
type AudioSearchService interface { AudioFileInfo(ctx context.Context, params SearchParams, page uint) ([]api.AudioFileInfo, error) internal.ActiveChecker }
type BotLocalStorage ¶
type BotLocalStorage struct {
// contains filtered or unexported fields
}
TODO Added autocleaning cache after a few days
func NewBotLocalStorage ¶
func NewBotLocalStorage() BotLocalStorage
func (BotLocalStorage) AudioFileInfo ¶
func (b BotLocalStorage) AudioFileInfo(ctx context.Context, params SearchParams, page uint) ([]api.AudioFileInfo, error)
func (BotLocalStorage) Get ¶
func (b BotLocalStorage) Get(ctx context.Context, params SearchParams) (path string, err error)
func (BotLocalStorage) Remove ¶
func (b BotLocalStorage) Remove(ctx context.Context, params SearchParams) error
type ChatHandler ¶
type ChatHandler struct { Ctx context.Context SpockVoiceChns SpockVoiceChannels GuildVoiceChats map[string]ChatInfo }
func (*ChatHandler) HandleVoiceChannelUpdate ¶
func (v *ChatHandler) HandleVoiceChannelUpdate(_ *discordgo.Session, vc *discordgo.VoiceStateUpdate)
type SearchParams ¶
type SearchParams struct { Type AudioQueryType Value string }
type SpockVoiceChannels ¶
type SpockVoiceChannels map[string]chan struct{}
func (SpockVoiceChannels) Close ¶
func (s SpockVoiceChannels) Close() error
Click to show internal directories.
Click to hide internal directories.