Adding Slash Commands to your Discord Bot | Nextcord (Full Tutorial)

Поделиться
HTML-код
  • Опубликовано: 28 ноя 2024
  • It's time to add Slash Command's to your Discord Bot!
    In April 2022 Discord has said that ALL Discord Bot's will have to use Slash Commands in order for the user to interact with the Discord Bot.
    In this video, I show you exactly how you can add Slash Commands to your Discord Bot as well as everything else to do with the topic. By the end of this video, you will have a fully functioning Discord Bot that uses Slash Commands.
    ►Links
    Switching from Discord.py to Nextcord: • Moving away from Disco...
    ►Please consider joining my discord server
    / discord
    ►If you would like to support me and this channel please consider donating on Patreon / s_james
    ►Social Media
    Instagram - / james.d.s_
    Twitter - / james_d_s
    Patreon - / s_james
    Discord - / discord
    ► Business Inquiries ONLY
    james.d.s.business@gmail.com

Комментарии • 42

  • @matt727
    @matt727 2 года назад +1

    ngl, i felt upset that Discord is removing the the prefix commands, but this is helpful for helping me migrate from prefix to slash commands.

  • @larrydev
    @larrydev 2 года назад +7

    Make sure when inviting your bot that it is set to "applications.command"

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

      any other specific permissions needed? thanks very much appreciated "applications.command" solved my issue.

  • @W1L7dev
    @W1L7dev 2 года назад +1

    Great video james! I've been strugling for days before your video! +1 subscriber!

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

      Thank you so much, I’m really glad that I was able to help :)

  • @BluePhantomStudio
    @BluePhantomStudio 2 года назад +1

    Hey, I want to use slash commands in my bot but I cant find my slash commands also It's not working. I have reinvited the bot with application.command too,k stiil not working. What is the problem here?

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

    Can you please make a new playlist because many of the things are updated!

  • @GreatScottBreaks
    @GreatScottBreaks 7 месяцев назад +1

    how can we make this work without knowing the serverid ? if we are not testing the bot and it is available to all servers, what do we do ?

  • @janmusil5825
    @janmusil5825 2 года назад +1

    Great and very useful video, will you make a video about buttons?

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

      Thank you, glad you like it. Yes definitely, video on that will be coming out shortly

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

    Love u James ure amazing ❤❤❤❤❤❤❤❤

  • @edujime23
    @edujime23 2 года назад +1

    will you make a video of slash commands in cogs?

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

      Yes definitely, video coming out very soon

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

    Thank you so much James

    • @James_S
      @James_S  2 года назад +1

      No problem at all, glad I was able to help :)

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

    James, is it possible to make moderation commands as a slash command?

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

    how do we make the slash commands global? i've let the bot up overnight without any guild_ids?

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

    How do you set up slash commands to play the audio clips that you've shown in past videoes? Like the piano clip

  • @voidbounds
    @voidbounds 2 года назад +1

    Bro in next episode pls make all slash commands of ban kick all

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

      I'll add that to my list of to do videos, thank you :)

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

    How to do optional arguments with slash commands? It seems like they are always required.

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

      to make the argument optional, the parameter arg should be arg=None

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

    im not downloading anything

  • @jw7-g3e
    @jw7-g3e 2 года назад

    Hey, any idea if one is able to send embeds with the interaction response? It doesn't seem to work for me, and i'm getting a weird traceback error. When i use the same code in in a normal bot event and use ctx.send(embed = embed) there is no error.

    • @jess.thetrain
      @jess.thetrain 2 года назад

      You need to use: await interaction.response.send_message(embed=embed)

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

    I'm having a an error when running my commands document. I don't know how to solve it
    raise HTTPException(response, data)
    nextcord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
    In description: This field is required
    pls help

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

      same lol

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

      I used to have that error in javascript make sure you arent using javascript and using python

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

      @@Mythical_Spectra how could someone mistake the coding language they are writing in like I am a stupid coder but i never had that issue no offence

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

    Are you fully aware this is full tutorial?

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

    next episode when?

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

      This week :)

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

    Could you share your code? my bot doesn't work 😥😥

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

      Hi, I'm really sorry that your bot doesn't work. I'm happy to help you fix it. I don't share code as I personally don't believe thats the best way to learn. Feel free to join my discord server and we'd be happy to help you get your bot working :)

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

    How can I do it in Cogs?

    • @James_S
      @James_S  2 года назад +1

      I’ve released another tutorial explaining how to do this :)

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

      @@James_S Ok Thanks😊

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

    I'd imagine your sub count would be higher if you did away with the weird vocal fry.

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

    dude nice videos but this isnt youtube kids (i think), stop it with the attention retention voice and cringy over emphasis.

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

      It is made for All ages

  • @user-gm8ul9ky6t
    @user-gm8ul9ky6t Год назад

    when i run the / command i get the
    "The application did not respond"
    message on discord, and the
    "Ignoring exception in command :
    Traceback (most recent call last):
    File "C:\Users\*myusername*\AppData\Roaming\Python\Python311\site-packages
    extcord\application_command.py", line 890, in invoke_callback_with_hooks
    await self(interaction, *args, **kwargs)
    File "C:\Users\thisi\OneDrive\Pictures\stuff (tm)\python\BobBot\main.py", line 36, in test
    await interaction.responce.send_message("Hello!!!")
    ^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'Interaction' object has no attribute 'responce'
    The above exception was the direct cause of the following exception:
    nextcord.errors.ApplicationInvokeError: Command raised an exception: AttributeError: 'Interaction' object has no attribute 'responce'"
    message in the terminal?
    my code reads as
    "@client.slash_command(name = "testcommand", description = "this is a test command", guild_ids=[*server id numbers, because when i had it as testServerId i kept getting errors*])
    async def test(interaction: Interaction):
    await interaction.responce.send_message("Hello!!!")"

    • @TheReaperZX
      @TheReaperZX 8 месяцев назад

      ik im super late but I fixed it by writing the arguments in this specific order: guild_ids,description,name
      example: @nextcord.slash_command(guild_ids=[testServerId],description="WOW",name="okk")
      I hope it helped