A wrapper for @discordjs/voice

Related tags

Video/Audio ezvoice
Overview

ezvoice

A lightweight package designed to make it just a bit easier to play and record sound with @discordjs/voice

Discord: nab138#2035

Examples

Connect to channel and play a song, then disconnect after it's done

const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
const voice = require('ezvoice')
const prefix = '!'

client.once('ready', () => {
	console.log('Ready!');
});
client.on('messageCreate', (message) => {
    if(!message.content.startsWith(prefix)) return
    let command = message.content.slice(prefix.length)
    if(command == 'play'){
        if(!message.member.voice.channel) return message.reply("You're not in a voice channel!")
        voice.play('./song.mp3', message.member.voice.channel) 
    }
})

client.login(token);

Record a user's voice to a file

const { MessageAttachment, Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
const voice = require('ezvoice')
const prefix = '!'

client.once('ready', () => {
	console.log('Ready!');
});
client.on('messageCreate', (message) => {
    if(!message.content.startsWith(prefix)) return
    let command = message.content.slice(prefix.length)
    if(command == 'record'){
        if(!message.member.voice.channel) return message.reply("You're not in a voice channel!")
        const connection = voice.connectToChannel(message.member.voice.channel)
        voice.recordToFile(connection.receiver, message.author.id, `${message.author.id}-recording.ogg`).then(() => {
            connection.destroy()
            const file = new MessageAttachment('./${message.author.id}-recording.ogg');
            message.channel.send({content: `Here's your recording:` files:[file]})
        })
    }
})
client.login(token)
You might also like...

Springlink - ♨️ springlink, a lightweight, fast, highly customizable and stable lavalink wrapper for Node.js 🟩

SpringLink ♨️ A lightweight, fast and stable lavalink wrapper for Node.js Features 🌹 Stable Feature-rich Customizable Lightweight Installation 🍮 (No

Nov 17, 2022

A lavalink wrapper in Node.js

Vulkava A lavalink wrapper in Node.JS Documentation Common errors/Issues 🔌 Installation You will need NodeJS v14+ and a running lavalink server. Offi

Dec 17, 2022

Featureful selfbot wrapper for its Discord selfbot

Featureful selfbot wrapper for its Discord selfbot

Featureful Selfbot wrapper for its Discord Selfbot. This library provides non-standard stuff such farming, intervals, and respect the ratelimit.

Nov 30, 2022

spotify.ts is an wrapper built around Spotify's Web API

spotify.ts About spotify.ts is an wrapper built around Spotify's Web API. Features Fast Object Oriented Typescript, ESM, CJS support Easy to Use Insta

Nov 17, 2022

Unofficial javascript wrapper to WhatsApp Cloud API.

heyooh Unofficial javascript wrapper to WhatsApp Cloud API. Its the javascript port for heyoo Features supported Sending messages Sending Media (image

Dec 30, 2022

The node.js v18 API wrapper for discordlist.gg

About This is an unofficial discordlist.gg package written for Typecript and JavaScript to interact with its public API. If you need help using this p

Dec 13, 2022

🎸 foolproof wrapper to stream what you're currently listening to

A lightweight Spotify API wrapper that allows you to display the music you're currently listening to 🎸 🎺 🖊 Getting started ⏪ Prerequisites Create a

Dec 29, 2022

A NodeJS package for voice channel interactions on Revolt. This package lets you join voice channels, play music and more!

Revoice.js - A Voice Module for Revolt This package is still in developement and lacks many features. You still are able to play sound to a voice chan

Dec 25, 2022

Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

May 18, 2022

Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

May 3, 2022

Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

Jan 3, 2023

Gerçekten her yeni özellik için npm'de hazır bir modül aramayın, gerek yok, lütfen. DiscordJS ile çok temel bir POST request yapabilirsiniz.

client.api.channels("847172505260261449").messages.post({ data: {"content":"Aşağıdaki menüden kendinize oyun seçebilirsiniz. Bir oyunun rolünü almak i

Nov 29, 2022

🤖 EvoBot is a Discord Music Bot built with discord.js & uses Command Handler from discordjs.guide

🤖 EvoBot is a Discord Music Bot built with discord.js & uses Command Handler from discordjs.guide

🤖 EvoBot is a Discord Music Bot built with discord.js & uses Command Handler from discordjs.guide

Jan 8, 2023

DiscordJS v13 Tutorials

DISCORDJS v13 EPISODES BY FLAMEQUARD If You Haven't Subscribe Us Please Its Our Request, Subscribe Us DiscordJS v13 Require NodeJS v16 To Install It I

Dec 11, 2022

Código fácil DiscordJS v13.

DISCORDJS TEMPLATE V13 BY MRGIOCODE Código fácil DiscordJS v13. Como inicializar el bot: Copia el repositorio. Crea un archivo .env para guardar el to

Dec 24, 2021

Powerful framework for DiscordJS.

WrenchWork WrenchWork is a powerful DiscordJS framework that allows you to create your own Discord bot in a clean environment. Features Modular struct

Jan 10, 2022

sıfırdan yazılmış discordjs-v14 gelişmiş, boş altyapı

DiscordJS v14 ile yapılmış gelişmiş, boş discord bot altyapısı. Sıfırdan yazılmıştır. Özellikle notlar kısmına dikkat edip, projede halihazırda buluna

Dec 30, 2022

Шаблон для ботів discord.js v14.8.0 із 100% охопленням Discord API, обробником команд, тощо на основі https://discordjs.guide/

Ласкаво просимо до шаблону дискорд бота Шаблон бота з відкритим вихідним кодом discord.js, який базується на офіційному посібнику з discord.js, щоб ро

Mar 18, 2023

Lightweight WebSocketServer wrapper lib using ws-wrapper to wrap connected WebSockets

ws-server-wrapper Lightweight WebSocketServer wrapper lib using ws-wrapper and ws to wrap connected WebSockets. The only dependency is ws-wrapper itse

May 9, 2022
Owner
null
Código fácil DiscordJS v13.

DISCORDJS TEMPLATE V13 BY MRGIOCODE Código fácil DiscordJS v13. Como inicializar el bot: Copia el repositorio. Crea un archivo .env para guardar el to

null 1 Dec 24, 2021
sıfırdan yazılmış discordjs-v14 gelişmiş, boş altyapı

DiscordJS v14 ile yapılmış gelişmiş, boş discord bot altyapısı. Sıfırdan yazılmıştır. Özellikle notlar kısmına dikkat edip, projede halihazırda buluna

null 7 Dec 30, 2022
:loudspeaker: A JavaScript library to add voice commands to your sites, apps or games.

Voix JS A JavaScript library to add voice commands to your sites, apps or games. NOTE: At this time, this library is only compatible with Google Chrom

Guille Paz 548 Dec 8, 2022
An simple package to create an Activity in Discord Voice Channel using Discord.js

discordjs-activity An simple package to create an Activity in Discord Voice Channel using Discord.js ?? | Installation npm install discordjs-activity

Sudhan 55 Nov 15, 2022
Link your position on a mcbe server to a discord voice. The sound changes according to the distance to the nearest players.

DiscordLink Link your position on a mcbe server to a discord voice. The sound changes according to the distance to the nearest players. Credits - No I

MaXoooZ 1 May 28, 2022
🤖 NODE.TS - Play a welcome sound every time someone joins the voice channel, meme bot. (Olha ele ae)

welcome2voice-bot ?? NODE.TS - Play a welcome sound every time someone joins the voice channel. ?? INVITE-ME ?? Installation Clone project git clone g

Bruno Silva 5 Feb 23, 2022
Telegram voice recognition bot

Node.js bot for telegram messenger based on Microsoft Azure Speech Service and Node.js Telegram Bot API

Dmitry 4 Mar 9, 2022
Hide your true voice from people and speak like a robot.

Hide your true voice from people and speak like a robot. Turn your speech into text and then turn the text into speech with tts engines.

null 3 Jun 3, 2022
Voice Controlled Discord Music Bot in discord.js v14

Voice Controlled Discord Bot This repository is for the 5th Hackathon of Documatic. With that Project I am aiming to place #1 and win 50€ About It is

Tomato6966 27 Nov 28, 2022
Easiest medium to use buttons with any discord API wrapper

Discord Buttons Plugin Easiest medium to use buttons with any discord API wrapper /* Generate 1st Button with "Yes" lable on it */ const button1

CTK WARRIOR 17 May 14, 2022