All Projects → lavalibs → lavaqueue

lavalibs / lavaqueue

Licence: MIT license
A queue system for Lavalink, backed by Redis.

Programming Languages

typescript
32286 projects
lua
6591 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to lavaqueue

Discord Music Bot
Discord Music Bot. Play, Playlist, Welcome and Administrative commands.
Stars: ✭ 18 (-25%)
Mutual labels:  lavalink
Spacebot
An open-source, multipurpose, configurable discord bot that does it all (that's the plan, at least)
Stars: ✭ 41 (+70.83%)
Mutual labels:  lavalink
MusicPlayer
A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls. This is Also The Source Code of The UserBot Which is Playing Music in @S1-BOTS Support Group ❤️
Stars: ✭ 218 (+808.33%)
Mutual labels:  playlist
TubeLister
A handy Chrome extension to collect all your YouTube tabs into one!
Stars: ✭ 19 (-20.83%)
Mutual labels:  playlist
lavalink-music-bot-2021
Advance Discord Lavalink Music Bot With Spotify and Buttons Help Menu || Best Music Quality || Radio Commands
Stars: ✭ 26 (+8.33%)
Mutual labels:  lavalink
Partify
This is a free open source Spotify-powered app that lets users host parties and have guests connect using their smartphones to submit and vote on songs. The app will only play the highest voted song and can connect to personal playlists.
Stars: ✭ 37 (+54.17%)
Mutual labels:  playlist
core
Simple JSON-based messaging queue for inter service communication
Stars: ✭ 28 (+16.67%)
Mutual labels:  redis-queue
flask-spark-docker
Just a boilerplate for PySpark and Flask
Stars: ✭ 32 (+33.33%)
Mutual labels:  redis-queue
mock-hls-server
Fake a live/event HLS stream from a VOD one. Useful for testing. Supports looping.
Stars: ✭ 61 (+154.17%)
Mutual labels:  playlist
spotilink
Parse Spotify URLs into Lavalink track objects.
Stars: ✭ 22 (-8.33%)
Mutual labels:  lavalink
mpv-scripts
A collection of scripts for mpv player
Stars: ✭ 138 (+475%)
Mutual labels:  playlist
Discord-Music-Turret-Bot
A standalone Discord music bot, made with DSharpPlus, using Lavalink.
Stars: ✭ 14 (-41.67%)
Mutual labels:  lavalink
waveplayer.js
An HTML5 based audio player with a waveform view
Stars: ✭ 73 (+204.17%)
Mutual labels:  playlist
geesome-node
🦈 Your self-hosted decentralized Messenger, Social network, Media file storage on top of IPFS! Freely communicate in encrypted chat groups, share images, video, text or any data without a risk of censorship or blocking.
Stars: ✭ 90 (+275%)
Mutual labels:  playlist
Appo-Music
A full-stack clone of the incredible Apple Music online streaming platform, with an aim to re-create it's core features, seamless design, and excellent user experience.
Stars: ✭ 82 (+241.67%)
Mutual labels:  playlist
jplayer-skin-audiocheck
A responsive HTML5 jPlayer skin with playlist.
Stars: ✭ 16 (-33.33%)
Mutual labels:  playlist
vue-music-player
🎵 basic music player, keeps your favorite musics
Stars: ✭ 77 (+220.83%)
Mutual labels:  playlist
nau-jukebox
Nâu Jukebox - share the song you love with the team, one person as host will play the song to listen together
Stars: ✭ 28 (+16.67%)
Mutual labels:  playlist
SFMediaStream
HTML5 media streamer library for playing music, video, playlist, or even live streaming microphone & camera with node server
Stars: ✭ 97 (+304.17%)
Mutual labels:  playlist
paystack-music-api
The bot and API that powers Paystack Music.
Stars: ✭ 70 (+191.67%)
Mutual labels:  playlist

Lavaqueue

lavalibs support server

A simple queue system for Lavalink, backed by Redis. Built as extension of my generic Lavalink wrapper.

How to use

const { Client: Lavaqueue } = require('lavaqueue');
const voice = new Lavaqueue({
  userID: '', // the user that will be sending audio
  password: '', // your lavalink password
  hosts: {
    rest: '', // your lavalink rest endpoint (include port and protocol)
    ws: '', // your lavalink ws endpoint (include port and protocol)
    redis: '', // your redis instance
  },
  send(guildID, packet) {
    // send the packet to the appropriate gateway connection
  },
  advanceBy(queue, { previous, remaining }) { // optional
    // called at the end of a track when the queue is otherwise unaware of how many tracks to
    // advance by; returns a number: 0 to repeat, negative to advance in reverse, positive to
    // advance forward
  },
});

async function connect() {
  const res = await voice.load('some identifier');
  const queue = voice.queues.get('some guild ID');

  await queue.player.join('channel id'); // join the voice channel
  await queue.add(...res.tracks.map(t => t.track)); // add songs to the queue
  await queue.start(); // start the queue
}

async function skip() {
  await voice.queues.get('some guild ID').next();
}

async function stop() {
  await voice.queues.get('some guild ID').stop();
}

Queues are resilient to crashes, meaning it's safe to blindly restart a queue: it will attempt to recover the previous song at the point the crash occurred. You can restart all currently playing queues by calling voice.queues.start(), although it is recommended to do so as infrequently as possible.

Reference

Queue

  • store: QueueStore
  • guildID: string
  • readonly player - the lavalink player
  • start(): Promise<boolean> - start the queue
  • add(...tracks: string[]): Promise<number> - add tracks to the queue
  • unshift(...tracks: string[]): Promise<number> - add tracks to the front of the queue
  • remove(track: string): PromiseLike<number> - remove a track from the queue
  • next(count: number = 1): Promise<boolean> - skip to the next song; pass negatives to advance in reverse, or 0 to repeat
  • sort(predicate?: (a: string, b: string) => number): Promise<number> - sort the upcoming tracks; resolves with the length of the queue
  • move(from: number, to: number): Promise<string[]> - move a track by index; resolves with the new list
  • shuffle(): Promise<string[]> - shuffle the list; resolves with the new list
  • splice(start: number, deleteCount?: number, ...tracks: string[]): Promise<string[]> - splice the list at the given position; works like Array#splice
  • trim(start: number, end: number): PromiseLike<string> - trim the queue to between the specified positions
  • stop(): Promise<void> - stop playback
  • clear(): PromiseLike<number> - clear the queue
  • current(): Promise<NP | null> - retrieve the current song: returns an object with properties track and position
  • tracks(start: number = 0, end: number = -1): Promise<string[]> - retrieves queued tracks
interface NP {
  position: number;
  track: string;
}

QueueStore extends Map<string, Queue>

  • client: Client
  • redis: Redis - the ioredis instance this queue store is using
  • start(filter?: (guildID: string) => boolean) - start all currently playing queues, with an optional filter callback
  • get(key: string): Queue - gets the specified queue, or creates one if none is found
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].