Documentation ¶
Overview ¶
Package handler contains the main Discord-related logic for handling messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ChannelID is the channel where the bot should listen to messages // from. ChannelID string }
TODO: move somewhere else
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewWithProviders ¶ added in v1.1.0
NewWithProviders creates a new handler with the provided providers.
func (*Handler) EventHandler ¶ added in v1.1.0
func (h *Handler) EventHandler(s *discordgo.Session, m *discordgo.MessageCreate)
Handler implements a discordgo.EventHandler for handling new messages being sent.
func (*Handler) NewURL ¶ added in v1.1.0
func (h *Handler) NewURL(ctx context.Context, urlStr string) (*streamingproviders.Song, []*streamingproviders.Song, error)
NewURL takes a URL and searches all enabled providers for it. It then searches all provides (minus the one the song was found on) and returns alternative streamingproviders where that song was found (the alternatives).
Click to show internal directories.
Click to hide internal directories.