github.com/meowstercatel/discordgo@v0.0.0-20250615204139-29b43d676735/examples/slash_commands/README.md (about)

     1  <img align="right" alt="DiscordGo logo" src="/docs/img/discordgo.svg" width="200">
     2  
     3  ## DiscordGo Slash Commands Example
     4  
     5  This example demonstrates how to utilize DiscordGo to create a Slash Command based bot,
     6  which would be able to listen and respond to interactions. This example covers all aspects
     7  of slash command interactions: options, choices, responses and followup messages.
     8  To avoid confusion, this example is more of a **step-by-step tutorial**, than a demonstration bot.
     9  
    10  **Join [Discord Gophers](https://discord.gg/0f1SbxBZjYoCtNPP)
    11  Discord chat channel for support.**
    12  
    13  ### Build
    14  
    15  This assumes you already have a working Go environment setup and that
    16  DiscordGo is correctly installed on your system.
    17  
    18  From within the slash_commands example folder, run the below command to compile the
    19  example.
    20  
    21  ```sh
    22  go build
    23  ```
    24  
    25  ### Usage
    26  
    27  ```
    28  Usage of slash_commands:
    29    -guild string
    30      	Test guild ID. If not passed - bot registers commands globally
    31    -rmcmd
    32      	Whether to remove all commands after shutting down (default true)
    33    -token string
    34      	Bot access token
    35  ```
    36  
    37  The below example shows how to start the bot from the slash_commands example folder.
    38  
    39  ```sh
    40  ./slash_commands -guild YOUR_TESTING_GUILD -token YOUR_BOT_TOKEN
    41  ```