Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discord-ytdl-core

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-ytdl-core - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3-dev

_config.yml

15

example.js
const ytdl = require("discord-ytdl-core");
const Discord = require("discord.js"); // discord.js v11.5.1
const Discord = require("discord.js");
const client = new Discord.Client();
client.on("ready", () => {
console.log("boom")
console.log("boom");
});

@@ -12,16 +12,13 @@

if (msg.content === "??play") {
if (!msg.member.voiceChannel) return msg.channel.send("You're not in a voice channel?");
if (!msg.member.voice.channel) return msg.channel.send("You're not in a voice channel?");
let input = ytdl("https://youtube.com/watch?v=7wtfhZwyrcc", {
filter: "audioonly",
quality: "highestaudio",
highWaterMark: 1 << 25,
encoderArgs: ['-af', 'equalizer=f=40:width_type=h:width=50:g=15']
});
msg.member.voiceChannel.join()
msg.member.voice.channel.join()
.then(connection => {
connection.playOpusStream(input,
connection.play(input,
{
highWaterMark: 1,
bitrate: 320000
type: "opus"
})

@@ -28,0 +25,0 @@ })

8

package.json
{
"name": "discord-ytdl-core",
"version": "1.0.2",
"version": "1.0.3-dev",
"description": "Simple ytdl wrapper for discord bots with custom ffmpeg args support.",

@@ -38,11 +38,11 @@ "main": "index.js",

"dependencies": {
"ffmpeg-static": "^4.0.1",
"prism-media": "^1.2.1",
"ytdl-core": "^1.0.9"
"ytdl-core": "^2.1.1"
},
"devDependencies": {
"@discordjs/opus": "^0.1.0",
"discord.js": "^11.5.1"
"discord.js": "^11.5.1",
"ffmpeg-static": "^4.0.1"
},
"runkitExampleFilename": "example.js"
}
# discord-ytdl-core
Simple ytdl wrapper for discord bots with custom ffmpeg args support.
[v1.0.3-dev]
```bash
npm i discord-ytdl-core
npm i INEX07/discord-ytdl-core
```

@@ -14,14 +15,25 @@

const ytdl = require("discord-ytdl-core");
const client = new (require("discord")).Client();
function playStream(connection) {
return connection.play(ytdl("url", {
encoderArgs: ['-af', 'equalizer=f=40:width_type=h:width=50:g=10']
client.on("ready", () => console.log("Online!"));
function playStream(connection, url) {
return connection.play(ytdl(url, {
encoderArgs: ['-af', 'equalizer=f=40:width_type=h:width=50:g=10'] // bassboost (ffmpeg args)
}), {
type: 'opus'
type: 'opus' // play as opus
})
}
client.on("message", async (message) => {
if (message.author.bot || !message.guild) return;
if (message.content.startsWith("?p")) {
let connection = await message.member.voice.channel.join();
return playStream(connection, "video_url");
}
client.login("TOKEN");
```
# Discord
**[Click Me](https://discord.gg/AHdaSqr)**
**[Click Me](https://discord.gg/5qN9fsF)**
const ytdl = require("../index");
const Discord = require("discord.js"); // discord.js v11.5.1
const Discord = require("discord.js");
const client = new Discord.Client();

@@ -12,17 +12,11 @@

if (msg.content === "??play") {
if (!msg.member.voiceChannel) return msg.channel.send("You're not in a voice channel?");
if (!msg.member.voice.channel) return msg.channel.send("You're not in a voice channel?");
let input = ytdl("https://youtube.com/watch?v=ERu6jh_1gR0", {
filter: "audioonly",
quality: "highestaudio",
highWaterMark: 1 << 25,
encoderArgs: ['-af', 'equalizer=f=40:width_type=h:width=50:g=10']
});
msg.member.voiceChannel.join()
msg.member.voice.channel.join()
.then(connection => {
connection.playOpusStream(input,
{
highWaterMark: 1,
bitrate: 320000
})
connection.play(input, { type: "opus" })
})

@@ -29,0 +23,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc