Documentation ¶
Index ¶
- Constants
- Variables
- func CanPlaySound(s *models.SoundboardSound, roles []int64) bool
- func DownloadNewSoundFile(r io.Reader, w io.Writer, limit int) (tooBig bool, err error)
- func GetSoundboardSounds(guildID int64, ctx context.Context) ([]*models.SoundboardSound, error)
- func HandleDelete(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func HandleGetCP(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func HandleNew(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func HandleUpdate(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func KeySoundLock(id int) string
- func ListSounds(sounds []*models.SoundboardSound, ms *dstate.MemberState) string
- func MaxSoundsForContext(ctx context.Context) int
- func RegisterPlugin()
- func RequestPlaySound(guildID int64, channelID, channelRanFrom int64, soundID int) (queued bool)
- func SoundFilePath(id int, status TranscodingStatus) string
- type PlayRequest
- type Plugin
- func (p *Plugin) AddCommands()
- func (p *Plugin) InitWeb()
- func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func (p *Plugin) PluginInfo() *common.PluginInfo
- func (p *Plugin) RunBackgroundWorker()
- func (p *Plugin) StopBackgroundWorker(wg *sync.WaitGroup)
- type PostForm
- type TranscodingStatus
Constants ¶
View Source
const ( MaxGuildSounds = 50 MaxGuildSoundsPremium = 250 )
View Source
const DBSchema = `` /* 1714-byte string literal not displayed */
Variables ¶
View Source
var (
ErrVoiceSendTimeout = errors.New("Voice send timeout")
)
View Source
var (
Silence = []byte{0xF8, 0xFF, 0xFE}
)
Functions ¶
func CanPlaySound ¶ added in v1.13.0
func CanPlaySound(s *models.SoundboardSound, roles []int64) bool
func DownloadNewSoundFile ¶ added in v1.4.1
func GetSoundboardSounds ¶ added in v1.13.0
func HandleDelete ¶
func HandleDelete(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func HandleGetCP ¶
func HandleGetCP(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func HandleNew ¶
func HandleNew(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func HandleUpdate ¶
func HandleUpdate(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func KeySoundLock ¶
func ListSounds ¶
func ListSounds(sounds []*models.SoundboardSound, ms *dstate.MemberState) string
func MaxSoundsForContext ¶ added in v1.6.0
func RegisterPlugin ¶
func RegisterPlugin()
func RequestPlaySound ¶
RequestPlaySound either queues up a sound to be played in an existing player or creates a new one
func SoundFilePath ¶
func SoundFilePath(id int, status TranscodingStatus) string
Types ¶
type PlayRequest ¶
type Plugin ¶
type Plugin struct{}
func (*Plugin) AddCommands ¶ added in v1.4.1
func (p *Plugin) AddCommands()
func (*Plugin) LoadServerHomeWidget ¶ added in v1.17.0
func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func (*Plugin) PluginInfo ¶ added in v1.17.0
func (p *Plugin) PluginInfo() *common.PluginInfo
func (*Plugin) RunBackgroundWorker ¶ added in v1.11.0
func (p *Plugin) RunBackgroundWorker()
func (*Plugin) StopBackgroundWorker ¶ added in v1.11.0
type PostForm ¶ added in v1.13.0
type PostForm struct { ID int Name string `valid:",100"` RequiredRoles []int64 `valid:"role"` BlacklistedRoles []int64 `valid:"role"` }
func (*PostForm) ToDBModel ¶ added in v1.13.0
func (pf *PostForm) ToDBModel() *models.SoundboardSound
type TranscodingStatus ¶
type TranscodingStatus int
const ( // In the transcoding queue TranscodingStatusQueued TranscodingStatus = iota // Done transcoding and ready to be played TranscodingStatusReady // Currently transcoding TranscodingStatusTranscoding // Failed transcoding, too long TranscodingStatusFailedLong // Failed transcofing, contact support TranscodingStatusFailedOther )
func (TranscodingStatus) String ¶
func (s TranscodingStatus) String() string
Click to show internal directories.
Click to hide internal directories.