# musicbr

> A simple Node.js based music extension/bot for Discord.js projects using YouTube.

Latest version **1.0.5** (published 2019-05-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install musicbr
pnpm add musicbr
yarn add musicbr
bun add musicbr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-05-20 |
| First published | 2019-05-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 84.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | vinimarotti |
| Maintainers | vinimarotti |
| Keywords | discord, discord.js, music, bot, addon, plugin |

## Links

- npm: https://www.npmjs.com/package/musicbr
- Repository: https://github.com/vinimarotti/musicbr
- Issues: https://github.com/vinimarotti/musicbr/issues
- npm.io page: https://npm.io/package/musicbr

## Dependencies (3)

- [ytpl](https://npm.io/package/ytpl.md) ^0.1.14
- [ytdl-core](https://npm.io/package/ytdl-core.md) ^0.29.1
- [ytsearcher](https://npm.io/package/ytsearcher.md) ^1.2.2

## Recent versions

- 1.0.5 (latest) — 2019-05-20
- 1.0.4 — 2019-05-20
- 1.0.3 — 2019-05-20
- 1.0.2 — 2019-05-20
- 1.0.1 — 2019-05-20
- 1.0.0 — 2019-05-20

## README

<div align="center">
  <p>
    <a href="https://nodei.co/npm/musicbr
/"><img src="https://nodei.co/npm/musicbr.png?downloads=true&stars=true" alt="NPM info" /></a>
  </p>
</div>  

# Discord MusicBot Addon
***  
* Esse modulo é uma modificação do  discord.js-musicbot-addon, totalmente (ou quase) traduzido para português.
* Para qualquer cópia desta versão, deve-se entrar em contato com o tradutor via Discord (Vinícius Marotti#6134).
* Copyright (c) 2018 - 2019, Darko Pendragon
* Copyright (c) 2018 - 2019, Vinícius Marotti (BR Version)

__The commands available are: (default names)__  
* `play <url>|<search string>`: Dá play em uma música do Youtube
* `search <search string>`: Procura os 10 videos do YT mais famosos sobre esse assunto.
* `skip [number]`: Skipa uma ou mais músicas com skip [numero]
* `queue [position]`: Mostra a fila atual.
* `pause`: Pausa a musica.
* `resume`: Dá play na musica.
* `remove [position]`: Remove a música de tal posição da fila.
* `volume`: Altera o volume da música (1 a 200).
* `disconnect`: Limpa a fila e sai do canal de voz.
* `clearqueue`: Limpa a fila.
* `musica`: Mostra a música que está tocando.  

__Permissions:__  
* If `anyoneCanSkip` ativada, qualquer um consegue skipar as músicas
* If `anyoneCanAdjust` ativada, qualquer um consegue alterar o volume
* If `ownerOverMember` ativada, o  (`Id do Dono`) tem todas as permissões do bot.

***
# Instalação
***  
__Pre-instalação:__  
1. `npm install discord.js`  
Essa é a base de qualquer bot em javascript 

2. `ffmpeg installed` __corretamente__ para seu sistema operacional.  
Permite o bot entrar no canal de voz e tocar a música.  

3. `ffmpeg-binaries` na sua paste node-modules. Você pode baixa-la [aqui pelo Mega.nz](http://ceesty.com/wM8aAE) e [aqui pelo Drive](http://ceesty.com/wM8syc)
Permite o bot entrar no canal de voz e tocar a música.  

4. `npm install node-opus` or `npm install opusscript`  
Required for voice. Discord.js _prefers_ node-opus.  

__Instalação:__  
* `npm install musicbr`  
Caso tenha problemas na instalação, veja [esse link](https://github.com/DarkoPendragon/discord.js-musicbot-addon/wiki/Installation-&-Troubleshooting), [entre no servidor do discord do desenvolvedor](https://discordapp.com/invite/bXvgdjV) ou fale comigo, estarei fazendo o máximo para te ajudar.
Note que a versão do NPM estará um pouco atrás da versão do GitHub.

# Exemplos
***  
Veja [essa página](https://github.com/DarkoPendragon/discord.js-musicbot-addon/blob/master/examples/examples.md) nos exemplos de repositorios.

# Options & Config.
***
__A maioria das opções é opicional.__  
As opções que você pode passar em `music.start (client, {options})` e seus tipos são as seguintes:

## Basic Options.
| Opção | Tipo | Descrição | Padrão |  
| --- | --- | --- | --- |
| youtubeKey | String | YouTube Data API3 key. Necessário para funcionar. | NaN |
| botPrefix | String | O prefixo do bot. Padrão é "?". | ? |
| messageNewSong | Boolean | Se enviar ou não uma mensagem quando uma nova música começar a ser reproduzida. | ativado |
| bigPicture | Boolean | Se deve usar uma imagem grande (verdadeira) ou pequena (falsa) para embeds. | desativado |
| maxQueueSize | Number | Tamanho máximo da fila. Padrão é 100. 0 para ilimitado. | 50 |
| defVolume | Number | O volume da música. 1 - 200. | 50 |
| anyoneCanSkip | Boolean | Qualquer um consegue pular as músicas. | desativado |
| messageHelp | Boolean | Permite enviar uma mensagem ao usuário sobre o uso do comando de ajuda. Se não puder, irá enviá-lo no canal como normal. | desativado |
| botAdmins | Object/Array | An array of Discord user ID's to be admins as the bot. They will ignore permissions for the bot. | [ ] |
| anyoneCanAdjust | Boolean | Whether anyone can adjust volume. | desativado |
| ownerOverMember | Boolean | Whether the owner over-rides `CanAdjust` and `CanSkip`. | flase |
| anyoneCanLeave | Boolean | Whether anyone can make the bot leave the currently connected channel. | desativado |
| ownerID | String | The ID of the Discord user to be seen as the owner. Required if using `ownerOverMember`. | NaN |
| logging | Boolean | Some extra none needed logging (such as caught errors that didn't crash the bot, etc). | ativado |
| requesterName | Boolean | Whether or not to display the username of the song requester. | ativado |
| inlineEmbeds | Boolean | Whether or not to make embed fields inline (help command and some fields are excluded). | desativado |
| musicPresence | Boolean | Whether or not to make the bot set its presence to currently playing music. | desativado |
| clearPresence | Boolean | Whether or not to clear the presence instead of setting it to "nothing" | desativado |
| insertMusic | Boolean | Whether or not to insert the music bot data into `<Client>.music` on start. | desativado |
| channelWhitelist | Object/Array | Sets a list of ID's allow when running messages. | [ ] |
| channelBlacklist | Object/Array | Sets a list of ID's ignore when running messages. | [ ] |
| bitRate | String | Sets the preferred bitRate for the Discord.js stream to use. | "120000" |
| nextPresence | [PresenceData](https://discord.js.org/#/docs/main/stable/typedef/PresenceData) | PresenceData to set after instead of clearing it (clearPresence). | null |

## Multi-Prefix Option Example
```js
<Client>.guilds.forEach
<Music>.start(<Client>, {
  youtubeKey: "Data Key",
  botPrefix: <MapObject>
});

// Exmaple Map Structure
{serverID: { prefix: "!" } }
```
See [examples](https://github.com/DarkoPendragon/musicbr/blob/master/examples/examples.md) for more info.
## Cooldown
| Option | Type | Description | Default |  
| --- | --- | --- | --- |
| cooldown | Object | The main cooldown object | |
| cooldown.enabled | Boolean | Whether or not cooldowns are enabled. | ativado |
| cooldown.timer | Number | Time in MS that cooldowns last. | 10000 |
| cooldown.exclude | Object/Array | Array 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`.
```js
music.start(client, {
  <command>: {
    enabled: false,                    // True/desativado 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.
  }
});
```

---
_Source: https://npm.io/package/musicbr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
