Music. Thanks for your video from 3 months ago, but I do have one slight issue that is kinda getting on my nerves for the past few days. The bot does everything but play music. It adds music to the queue, etc. but it doesn't play any audio. Can you help please?
Here's my code: @commands.command(name="play", aliases=['p'], description="Plays the selected song from UA-cam.") async def play(self, ctx, *args): query = " ".join(args)
voice_channel = ctx.author.voice.channel if voice_channel is None: await ctx.reply("Please connect to a voice channel so that the bot knows where to go!") elif self.is_paused: self.vc.resume() else: song = self.search_yt(query) if type(song) == type(True): await ctx.reply("Could not download the song. Incorrect format, please try different keywords.") else: await ctx.reply("The song has been added to the queue.") self.music_queue.append([song, voice_channel])
if self.is_playing == False: await self.play_music(ctx) also im doing this on a server with 12 members so is it ok if i pull music from youtube ?
@@Bakugan2833 Hi, thank you. Actually, I did some internet search and found that it has to do with updates: "In discord.js v14, intent flags are available from GatewayIntentBits" so what you've found is correct. Looks like a fairly recent change :)
What discord bot did you always wanted to make?
Music. Thanks for your video from 3 months ago, but I do have one slight issue that is kinda getting on my nerves for the past few days. The bot does everything but play music. It adds music to the queue, etc. but it doesn't play any audio. Can you help please?
Here's my code:
@commands.command(name="play", aliases=['p'], description="Plays the selected song from UA-cam.")
async def play(self, ctx, *args):
query = " ".join(args)
voice_channel = ctx.author.voice.channel
if voice_channel is None:
await ctx.reply("Please connect to a voice channel so that the bot knows where to go!")
elif self.is_paused:
self.vc.resume()
else:
song = self.search_yt(query)
if type(song) == type(True):
await ctx.reply("Could not download the song. Incorrect format, please try different keywords.")
else:
await ctx.reply("The song has been added to the queue.")
self.music_queue.append([song, voice_channel])
if self.is_playing == False:
await self.play_music(ctx)
also im doing this on a server with 12 members so is it ok if i pull music from youtube ?
@@ESIMapping this might be something to do with your ffmpeg installation. Do you get any errors in the console?
@@Computeshorts No but my path file doesnt have the C:\ffmpeg\bin after i've set it. when i do the set path=%path%;c:/ffmpeg/bin it gives me an error.
@@ESIMapping what's the error that you get?
Great video! Really helpful for getting started with slash commands
Really digging the way you explain everything! Thanks!
Moving from v12 to v13 and changing my host. This is helpful. Thx
One of the best tutorials for a beginner level discord bot out there.
um, shouldnt you blur out the token at 1:53 ?
Yeah in theory but I delete the bots after the video so the token gets invalidated.
@@Computeshorts oh ok
TypeError: Cannot read properties of undefined (reading 'member')
at Object.execute (C:\Users\yilan\Desktop\discord bot\src\commands\tools\play.js:34:20)
Thank you for this great tutorial on how to make a DC bot. Really begginer friendly :D
TypeError: Cannot read properties of undefined (reading 'FLAGS')
I'm maybe late but how can I make that only role with administrator can see command and use it?
Cannot read properties of undefined (reading 'FLAGS') how can i fix that?
In index.js on line 11, change the code to this: intents: ["Guilds", "GuildMessages"]
client.commands.set(command.data.name, command);
^
TypeError: Cannot read properties of undefined (reading 'name')
He fixes this at 12:33
Can you make a tutorial showing what for example what const is for route’s requirements etc?
I get this: TypeError: command.push is not a function
Thank you :)
Why do you use require and module.exports and not import and export?
Why not?
Its not working for me
bro you made a cut when making the env file so I dont even know how to do that smh
You dont know how to create a file?
Hi, how do you add flag guilds? I cannot find it anywhere. I've installed all as shown but don't have any option for that.
yeah also run into this issue. I got this error TypeError: Cannot read properties of undefined (reading 'FLAGS')
i did this instead. not sure if its the right solution though
intents: ['Guilds','GuildMessages']
@@Bakugan2833 Hi, thank you. Actually, I did some internet search and found that it has to do with updates:
"In discord.js v14, intent flags are available from GatewayIntentBits" so what you've found is correct. Looks like a fairly recent change :)
@@Bakugan2833 in v13 its intents: [Intents.FLAGS.Guilds]
In v14 it's intents: [GatewayIntentBits.Guilds]
Their audacity to call this thing a "framework"
am getting "intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILDS_MESSAGES]"
You should do intents: ["Guilds", "GuildMessages"]
@@zenex7941 the application isnt responding