Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dc-music-bot-addmon-chinese

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dc-music-bot-addmon-chinese

discord音樂機器人擴充中文翻譯版

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

NPM info

Discord MusicBot Addon


This module is a simple Node.js based music extension/bot for Discord.js projects using YouTube. This was originally an update of an older addon for newer versions of Discord.js but not serves as it's own module.

The commands available are: (default names)

  • musichelp [command]: Displays help text for commands by this addon, or help for a specific command.
  • play <url>|<search string>: Play audio from YouTube.
  • search <search string>: Search's for up to 10 videos from YT.
  • skip [number]: Skip a song or multi songs with skip [some number].
  • queue [position]: Display the current queue.
  • pause: Pause music playback.
  • resume: Resume music playback.
  • remove [position]: Remove a song from the queue by position.
  • volume: Adjust the playback volume between 1 and 200.
  • leave: Clears the song queue and leaves the channel.
  • clearqueue: Clears the song queue.
  • np: Show the current playing song.

Permissions:

  • If anyoneCanSkip is true, anyone can skip songs in the queue.
  • If anyoneCanAdjust is true, anyone can adjust the volume.
  • If ownerOverMember is true, the set ID of the user (ownerID) will over-ride permissions from the bot.

Installation


Pre-installation:

  1. npm install discord.js
    It is recommended to have the stable branch.

  2. ffmpeg installed correctly for your OS/env.
    Allows the bot to join voice as well as speak.

  3. npm install node-opus or npm install opusscript
    Required for voice. Discord.js prefers node-opus.

Installation:

  • npm install discord.js-musicbot-addon
    If you have troubles installing, see this link or join the discord server. Note that the NPM version will be slightly behind the GitHub version.

Examples


See this page on the repo for examples.

Options & Config.


Most options are optional and thus not needed.
The options you can pass in music.start(client, {options}) and their types is as followed:

Basic Options.

OptionTypeDescriptionDefault
youtubeKeyStringA YouTube Data API3 key. Required to run.NaN
botPrefixStringThe prefix of the bot. Defaults to "!". Can also be a Map of prefix's.!
messageNewSongBooleanWhether or not to send a message when a new song starts playing.true
bigPictureBooleanWhether to use a large (true) image or small (false) for embeds.false
maxQueueSizeNumberMax queue size allowed. Defaults 100. Set to 0 for unlimited.50
defVolumeNumberThe default volume of music. 1 - 200.50
anyoneCanSkipBooleanWhether or not anyone can skip.false
messageHelpBooleanWhether to message the user on help command usage. If it can't, it will send it in the channel like normal.false
botAdminsObject/ArrayAn array of Discord user ID's to be admins as the bot. They will ignore permissions for the bot.[ ]
anyoneCanAdjustBooleanWhether anyone can adjust volume.false
ownerOverMemberBooleanWhether the owner over-rides CanAdjust and CanSkip.false
anyoneCanLeaveBooleanWhether anyone can make the bot leave the currently connected channel.false
ownerIDStringThe ID of the Discord user to be seen as the owner. Required if using ownerOverMember.NaN
loggingBooleanSome extra none needed logging (such as caught errors that didn't crash the bot, etc).true
requesterNameBooleanWhether or not to display the username of the song requester.true
inlineEmbedsBooleanWhether or not to make embed fields inline (help command and some fields are excluded).false
musicPresenceBooleanWhether or not to make the bot set its presence to currently playing music.false
clearPresenceBooleanWhether or not to clear the presence instead of setting it to "nothing"false
insertMusicBooleanWhether or not to insert the music bot data into <Client>.music on start.false
channelWhitelistObject/ArraySets a list of ID's allow when running messages.[ ]
channelBlacklistObject/ArraySets a list of ID's ignore when running messages.[ ]
bitRateStringSets the preferred bitRate for the Discord.js stream to use."120000"
nextPresencePresenceDataPresenceData to set after instead of clearing it (clearPresence).null

Multi-Prefix Option Example

<Client>.guilds.forEach
<Music>.start(<Client>, {
  youtubeKey: "Data Key",
  botPrefix: <MapObject>
});

// Exmaple Map Structure
{serverID: { prefix: "!" } }

See examples for more info.

Cooldown

OptionTypeDescriptionDefault
cooldownObjectThe main cooldown object
cooldown.enabledBooleanWhether or not cooldowns are enabled.true
cooldown.timerNumberTime in MS that cooldowns last.10000
cooldown.excludeObject/ArrayArray of command names to exclude. Uses default names, not set names["volume","queue","pause","resume","np"]

Command Options.

Commands pass a bit different. Each command follows the same format as below. Valid commands are play, remove, help, np, queue, volume, pause, resume, skip, clearqueue, loop, leave.

music.start(client, {
  <command>: {
    enabled: false,                    // True/False statement.
    alt: ["name1","name2","name3"],    // Array of alt names (aliases).
    help: "Help text.",                // String of help text.
    name: "play"                       // Name of the command.
    usage: "{{prefix}}play bad memes", // Usage text. {{prefix}} will insert the bots prefix.
    exclude: false                     // Excludes the command from the help command.
  }
});

Keywords

FAQs

Package last updated on 20 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc