Learn Discord JS in 15 min

Поделиться
HTML-код
  • Опубликовано: 31 янв 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 RUclips.")
      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

  • @hkm93
    @hkm93 2 года назад

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

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

  • @Ps3Freak672
    @Ps3Freak672 2 года назад

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

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

  • @norbii222
    @norbii222 Год назад +1

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

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

  • @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')

  • @Pijonizumu
    @Pijonizumu Год назад

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

  • @Enam
    @Enam 2 года назад

    Thank you :)

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

  • @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?

  • @RinatWOT
    @RinatWOT 2 года назад

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

  • @ebbenilsson8568
    @ebbenilsson8568 2 года назад

    Its not working for me

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