MCPcopy Index your code
hub / github.com/Weeb-Devs/Laffey

github.com/Weeb-Devs/Laffey @2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.0.0 ↗ · + Follow
137 symbols 251 edges 59 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Laffey

An adorable lavalink discord music bot that has a lot of features inside it.

laffey

© Azur Lane | First Project of Weeb-Devs

Features:

✓ High quality
✓ Support filters
✓ Auto resume
✓ Stable
✓ Suport 8 music sources
✓ Feature-rich
✓ per guild prefix configuration
✓ and of course, adorable shipgirl

Current version:

Requirements:

Lavalink server

You need dev lavalink version to use our filters. You can get it by clicking Here and then, click on Lavalink.jar files How to setup
All required OS and other for lavalink server available here

Server for the bot to run

  • nodejs v14 or newer because we're using optional chaining method
  • discordjs v12

Data

  • Discord bot's token You should know why you need this Get or create bot here | How to get your bot's token
  • Mongodb URI for prefix and auto resume feature. It won't work if you enter an invalid URI MongoDB
  • Your ID for eval command. please note that it's dangerous if eval is accessible to everyone
  • Spotify client ID for spotify support Click here to get
  • Spotify client Secret for spotify support Click here to get
  • Ksoft API Key not required, depends on your chosen lyrics engine Click here to get
  • Genius API Key not required, depends on your chosen lyrics engine Click here to get
  • Lavalink server
    • Host url to your lavalink server
    • Password your lavalink's password. Defaults to youshallnotpass
    • Port port for your lavalink server. Defaults to 80
    • Identifier Name for your node. Defaults to it's url
    • Retry amount retry amount when the node encountered an error. Defaults to 3
    • Retry delay delay for each retry. Defaults to 1000 ms
    • Secure wether your node uses an ssl connection. Defaults to false

Available music sources:

  • youtube*
  • bandcamp*
  • soundcloud*
  • twitch*
  • vimeo*
  • http (you can use radio for it)*
  • spotify*
  • deezer*

Note: - * depends on your lavalink's configuration

Configuration & Starting the bot:

With config.json

  1. First, change config.json.example's name into config.json, and fill it with the following;
{
  "TOKEN": "Your bot's token",
  "PREFIX": "?",
  "OWNERS": [
    "Your id, can be more than 1"
  ],
  "MONGODB_URI": "For database",
  "SPOTIFY_CLIENT_ID": "For spotify support",
  "SPOTIFY_CLIENT_SECRET": "For spotify support",
  "KSOFT_API_KEY": "For the lyrics. It depend on your choice",
  "GENIUS_API_KEY": "For the lyrics. It depend on your choice",
  "LYRICS_ENGINE": "There are 3 options. ksoft ; genius ; google . Google doesn't need any API",
  "NODES": [
    {
      "HOST": "Your node's host",
      "PASSWORD": "Your node's password",
      "PORT": 80,
      "IDENTIFIER": "This is node's identifier, it's all up to you",
      "RETRY_AMOUNT": 3,
      "RETRY_DELAY": 1000,
      "SECURE": false
    }
  ],
  "AUTO_RESUME_DELAY": 1500,
  "DEBUG": true,
  "LOG_USAGE": false
}
  1. Go to your console, and type cd "path to laffey's file" and install all dependencies by typing npm i
  2. You're ready to go, use node . or npm start to start the bot

With .env

  1. Create a .env file in the root directory of your project.

  2. Copy the text below and paste it in .env file and change the value with required data. ⚠️NODES in .env must be a STRINGIFIED array of node objects, or you can use normal array for nodes in config.json⚠️

#### .env file TOKEN=TOKEN_HERE PREFIX=? OWNERS=123456789,987654321 MONGODB_URI=mongodb+srv://blabla SPOTIFY_CLIENT_ID=123456 SPOTIFY_CLIENT_SECRET=ABCDEFG KSOFT_API_KEY=1234 GENIUS_API_KEY=1234 LYRICS_ENGINE=google AUTO_RESUME_DELAY=2000 NODES=[{"HOST":"Your node's host","PASSWORD":"Your node's password","PORT":80,"IDENTIFIER":"This node's identifier, it's up to you","RETRY_AMOUNT":3,"RETRY_DELAY":1000,"SECURE":false}] DEBUG=true LOG_USAGE=false
#### config.json file (you don't need this if you already provided NODES in .env) json { "NODES": [ { "HOST": "Your node's host", "PASSWORD": "Your node's password", "PORT": 80, "IDENTIFIER": "This node's identifier, it's up to you", "RETRY_AMOUNT": 3, "RETRY_DELAY": 1000, "SECURE": false } ] } 3. Go to your console, and type cd "path to laffey's file" and install all dependencies by typing npm i 4. You're ready to go, use node . or npm start to start the bot

Note:

- `DEBUG` is to see more info when your bot is starting or when a warning was thrown
- `LOG_USAGE` is to log all command usage by user. Defaults to false because it'll be annoying
- `AUTO_RESUME_DELAY` is how many ms do you want to add a delay between guild on auto resume

Screenshots

Commands

  • music

    • play plays a music from 7 different music sources
      -aliases: p
      -example: ?play https://www.youtube.com/playlist?list=PL0jh16Vp3NzVjEjKbZ3pV4f15Jze5EANV

    • forceplay same like play, but this will force the player to play a specific song
      -aliases: fp
      -example: ?forceplay https://www.youtube.com/watch?v=dQw4w9WgXcQ

    • loop toggle track/queue loop
      -aliases: l
      -example: ?loop

    • lyrics Get specific/current playing song's lyrics
      -aliases: ly
      -example: ?lyrics [ song's title ]

    • volume Set player's volume. 0-1000
      -aliases: v
      -example: ?volume 1000

    • nowplaying see the song currently playing
      -aliases: np
      -example: ?nowplaying

    • move Move song
      -aliases: -
      -example: ?move 2 | ?move 4 3

    • queue check all songs inside queue
      -aliases: q
      -example: ?queue

    • skip skip the song
      -aliases: s
      -example: ?skip

    • skipto skip to a specific song
      -aliases: st, jump, jumpto
      -example: ?skipto 3

    • join Join a voice channel
      -aliases: -
      -example: ?join

    • leave Leave a voice channel
      -aliases: stop
      -example: ?leave

    • shuffle Shuffle queue
      -aliases: -
      -example: ?shuffle

    • search search song
      -aliases: -
      -example: ?search never gonna give you up

    • clear Clear the queue
      -aliases: -
      -example: ?clear

    • bassboost Set bassboost filter for the player
      -aliases: bb
      -example: ?bassboost [reset | 1 - 2000]

    • 24h whether the bot should leave vc when there's no user or not
      -aliases: -
      -example: ?24h

    • vaporwave Set vaporwave filter for the player
      -aliases: -
      -example: ?vaporwave

    • nightcore Set nightcore filter for the player
      -aliases: nc
      -example: ?nightcore

    • 8d Set 8d filter for the player
      -aliases: -
      -example: ?8d

    • speed Set speed for the player
      -aliases: -
      -example: ?speed [reset | 0-5]

    • pitch Set pitch for the player
      -aliases: -
      -example: ?pitch [reset | 0-5]

    • reset Reset the filters
      -aliases: -
      -example: ?reset

    • filters Get all filters status
      -aliases: -
      -example: ?filters

    • remove Remove song from queue
      -aliases: -
      -example: ?remove 3

    • previous Play previously played song
      -aliases: pr
      -example: ?previous

    • resume Resume the player
      -aliases: r
      -example: ?resume

    • pause Pause the player
      -aliases: -
      -example: ?pause

  • config

    • prefix get, set, or reset prefix on guild
      -aliases: -
      -example: ?prefix set ! | ?prefix reset | ?prefix get
  • misc

    • ping get bot's ping
      -aliases: -
      -example: ?ping

    • help Show list of available commands
      -aliases: h
      -example: ?help play

    • eval to evaluate code
      -aliases: -
      -example: ?eval message.channel.send('hello')

    • about Give information about this project
      -aliases: -
      -example: ?about

    • stats Give bot's stats
      -aliases: -
      -example: ?stats adv

    • node Give lavalink's stats
      -aliases: -
      -example: ?node

    • invite Invite your bot to another guild
      -aliases: -
      -example: ?invite

Description & About

Created at: Friday, 2 April 2021
Published at: Sunday, 11 April 2021
Laffey is Weeb-Devs 's first project. It was created by our first member aka owner, Takiyo. He really wants to make his first open source project ever. Because he wants more coding experience. In this project, he was challenged to make a project with less bugs. Hope you enjoy using Laffey!

Core symbols most depended-on inside this repo

savePlayer
called by 26
src/modules/playerHandler.js
delete
called by 24
src/modules/playerHandler.js
log
called by 21
src/handlers/logger.js
add
called by 17
src/modules/paginator.js
debug
called by 8
src/handlers/logger.js
setNightcore
called by 7
src/lavalink/player.js
setVaporwave
called by 7
src/lavalink/player.js
setBassboost
called by 6
src/lavalink/player.js

Shape

Function 59
Method 58
Class 20

Languages

TypeScript100%

Modules by API surface

src/lavalink/player.js18 symbols
src/modules/laffeyUtils.js15 symbols
src/modules/playerHandler.js8 symbols
src/modules/lyricsHandler.js8 symbols
src/modules/paginator.js7 symbols
src/handlers/logger.js6 symbols
src/Laffey.js5 symbols
src/modules/eventHandler.js4 symbols
src/lavalink/index.js4 symbols
src/commands/music/queue.js4 symbols
src/commands/misc/stats.js4 symbols
src/cache/prefix.js4 symbols

Datastores touched

autoResumeCollection · 1 repos
(mongodb)Database · 1 repos

For agents

$ claude mcp add Laffey \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact