Looking for help on a small discord bot project
Hello I am trying to make a small discord bot that will download videos from YouTube upon a user doing /reqest (url) and then it has a cooldown is this something someone can help me with thanks
11 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by staffconst Discord = require('discord.js');
const ytdl = require('ytdl-core');
const fs = require('fs');
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
],
});
client.on('messageCreate', async message => {
if (message.content.startsWith('/request')) {
const url = message.content.split(' ')[1];
const stream = ytdl(url, { filter: 'audioonly' });
stream.pipe(fs.createWriteStream('output.mp3'));
}
});
client.login('token');
we do not support tos violations
how is this in violation tos
its not for a music bot
downloading videos is agains youtube's tos
no its not if you have premium
I have premium
It still is
Now kindly stop
its not but ok
About YouTube Premium. You're allowed to download from the YouTube app only.
https://www.youtube.com/t/terms_paidservice
(they left lmao)