npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

musicbr

v1.0.5

Published

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

Downloads

5

Readme

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 e aqui pelo Drive 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:

Exemplos


Veja essa página 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 | PresenceData 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

| 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.

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.
  }
});