Learn Discord JS in 15 min

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 49

  • @Computeshorts
    @Computeshorts  2 роки тому +14

    What discord bot did you always wanted to make?

    • @ESIMapping
      @ESIMapping 2 роки тому +2

      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?

    • @ESIMapping
      @ESIMapping 2 роки тому

      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 ?

    • @Computeshorts
      @Computeshorts  2 роки тому

      @@ESIMapping this might be something to do with your ffmpeg installation. Do you get any errors in the console?

    • @ESIMapping
      @ESIMapping 2 роки тому

      @@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.

    • @Computeshorts
      @Computeshorts  2 роки тому

      @@ESIMapping what's the error that you get?

  • @faus585
    @faus585 2 роки тому +6

    Great video! Really helpful for getting started with slash commands

  • @Codexbits
    @Codexbits Рік тому

    Really digging the way you explain everything! Thanks!

  • @CoolPage994
    @CoolPage994 2 роки тому +1

    Moving from v12 to v13 and changing my host. This is helpful. Thx

  • @hkm93
    @hkm93 2 роки тому

    One of the best tutorials for a beginner level discord bot out there.

  • @brushush
    @brushush 2 роки тому +3

    um, shouldnt you blur out the token at 1:53 ?

    • @Computeshorts
      @Computeshorts  2 роки тому +1

      Yeah in theory but I delete the bots after the video so the token gets invalidated.

    • @brushush
      @brushush 2 роки тому +1

      @@Computeshorts oh ok

  • @willdeng7669
    @willdeng7669 Рік тому +1

    TypeError: Cannot read properties of undefined (reading 'member')
    at Object.execute (C:\Users\yilan\Desktop\discord bot\src\commands\tools\play.js:34:20)

  • @Ps3Freak672
    @Ps3Freak672 2 роки тому

    Thank you for this great tutorial on how to make a DC bot. Really begginer friendly :D

  • @norbii222
    @norbii222 Рік тому +1

    TypeError: Cannot read properties of undefined (reading 'FLAGS')

  • @Pijonizumu
    @Pijonizumu Рік тому

    I'm maybe late but how can I make that only role with administrator can see command and use it?

  • @simo4242
    @simo4242 2 роки тому +1

    Cannot read properties of undefined (reading 'FLAGS') how can i fix that?

    • @Official_NoobGamer
      @Official_NoobGamer 2 роки тому +3

      In index.js on line 11, change the code to this: intents: ["Guilds", "GuildMessages"]

  • @zonixwzone
    @zonixwzone Рік тому +1

    client.commands.set(command.data.name, command);
    ^
    TypeError: Cannot read properties of undefined (reading 'name')

  • @ronaldeatsapple9517
    @ronaldeatsapple9517 2 роки тому

    Can you make a tutorial showing what for example what const is for route’s requirements etc?

  • @TheNVS
    @TheNVS Рік тому

    I get this: TypeError: command.push is not a function

  • @Enam
    @Enam 2 роки тому

    Thank you :)

  • @RinatWOT
    @RinatWOT 2 роки тому

    Why do you use require and module.exports and not import and export?

  • @ebbenilsson8568
    @ebbenilsson8568 2 роки тому

    Its not working for me

  • @itsvis
    @itsvis 2 роки тому +2

    bro you made a cut when making the env file so I dont even know how to do that smh

    • @Duluper
      @Duluper Рік тому

      You dont know how to create a file?

  • @lobiviak
    @lobiviak 2 роки тому

    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.

    • @Bakugan2833
      @Bakugan2833 2 роки тому

      yeah also run into this issue. I got this error TypeError: Cannot read properties of undefined (reading 'FLAGS')

    • @Bakugan2833
      @Bakugan2833 2 роки тому +3

      i did this instead. not sure if its the right solution though
      intents: ['Guilds','GuildMessages']

    • @lobiviak
      @lobiviak 2 роки тому +2

      @@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 :)

    • @jcgamer1650
      @jcgamer1650 2 роки тому

      @@Bakugan2833 in v13 its intents: [Intents.FLAGS.Guilds]
      In v14 it's intents: [GatewayIntentBits.Guilds]

  • @baggier
    @baggier Рік тому +1

    Their audacity to call this thing a "framework"

  • @realsigmatude
    @realsigmatude 2 роки тому +1

    am getting "intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILDS_MESSAGES]"

    • @zenex7941
      @zenex7941 2 роки тому +1

      You should do intents: ["Guilds", "GuildMessages"]

    • @Official_NoobGamer
      @Official_NoobGamer 2 роки тому

      @@zenex7941 the application isnt responding