musicplugin

package
v0.0.0-...-99912da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2018 License: MIT Imports: 15 Imported by: 0

README

===== This is a music plugin for the bruxism multi-service bot.

This code is in very early stages and is still a bit messy.

Requirements

  • ffmpeg must be installed and within your PATH
  • youtube-dl must be installed and exist in the same folder as bruxism.
  • dca must be installed and exist in the same folder as bruxism.

Music Plugin Commands

  • NOTE: All commands must be prefixed with a @mention of your bot
  • NOTE: music can be abbreviated with just mu

Format

@botname music <required> [optional] [this | or this]

Commands Quick Reference

Command Arguments Action
music join [channelID] Join channel of caller or provided channel ID
music leave Leave the currently connected voice channel.
music play [url] Start queue player and optionally enqueue a URL
music info Display plugin / queue / playing song info
music pause Pause playback.
music resume Resume playback.
music skip Skip current song.
music stop Stop queue player.
music loop Toggle Loop Queue setting
music list List all items in queue.
music clear Clear all items from queue.

Notes

For faster startup of youtube-dl use github cloned version of youtube-dl, see https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=83763

To avoid youtube-dl ffmpeg post processing error, use a youtube-dl version past this commit https://github.com/rg3/youtube-dl/commit/e38cafe986994d65230e6518752def8b53ad7308 see issue https://github.com/rg3/youtube-dl/issues/8729#event-574790956

Author

Bruce Marriner

Documentation

Index

Constants

View Source
const (
	Skip controlMessage = iota
	Pause
	Resume
)

Variables

This section is empty.

Functions

func New

func New(discord *bruxism.Discord) bruxism.Plugin

New will create a new music plugin.

Types

type MusicPlugin

type MusicPlugin struct {
	sync.Mutex

	VoiceConnections map[string]*voiceConnection
	// contains filtered or unexported fields
}

func (*MusicPlugin) Help

func (p *MusicPlugin) Help(bot *bruxism.Bot, service bruxism.Service, message bruxism.Message, detailed bool) []string

Help returns a list of help strings that are printed when the user requests them.

func (*MusicPlugin) Load

func (p *MusicPlugin) Load(bot *bruxism.Bot, service bruxism.Service, data []byte) (err error)

Load will load plugin state from a byte array.

func (*MusicPlugin) Message

func (p *MusicPlugin) Message(bot *bruxism.Bot, service bruxism.Service, message bruxism.Message)

Message handler.

func (*MusicPlugin) Name

func (p *MusicPlugin) Name() string

Name returns the name of the plugin.

func (*MusicPlugin) Save

func (p *MusicPlugin) Save() ([]byte, error)

Save will save plugin state to a byte array.

func (*MusicPlugin) Stats

func (p *MusicPlugin) Stats(bot *bruxism.Bot, service bruxism.Service, message bruxism.Message) []string

Stats will return the stats for a plugin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL