Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notification ¶
type Notification int8
const ( // NewSongs notification for a new song added to the queue NewSongs Notification = iota // Skip notification for a song being skipped Skip // Pause notification for a song being paused Pause // Resume notification for a song being resumed Resume // Clear notification for the queue being cleared Clear // Finished notification for the queue being finished Finished // Playing notification for a song starting to play Playing // PrioritySong notification for a song being added to the queue with priority PrioritySong // LoopFinished notification for a song finishing a loop LoopFinished )
type NotificationMessage ¶
type NotificationMessage struct { Notification Notification `json:"notification"` Songs []queue.Element `json:"song,omitempty"` Guild string `json:"-"` }
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func (*Notifier) AddChannel ¶
func (n *Notifier) AddChannel(channel chan<- NotificationMessage, guild string)
AddChannel adds a channel to the notifier for the given guild
func (*Notifier) Notify ¶
func (n *Notifier) Notify(guild string, message NotificationMessage)
Notify sends a notification to all channels in the notifier for the given guild (if any)
func (*Notifier) RemoveChannel ¶
func (n *Notifier) RemoveChannel(channel chan<- NotificationMessage, guild string) bool
RemoveChannel removes a channel from the notifier, closing it in the process and returning true if it was found
Click to show internal directories.
Click to hide internal directories.