Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new slash commands #5

Closed
xbenjii opened this issue Dec 16, 2020 · 1 comment · Fixed by #71
Closed

Support new slash commands #5

xbenjii opened this issue Dec 16, 2020 · 1 comment · Fixed by #71
Assignees
Labels
enhancement New feature or request

Comments

@xbenjii
Copy link

xbenjii commented Dec 16, 2020

Describe your feature request in as much detail as you can here.

  • It is a feature supported by Discord's API, but missing from the library

https://discord.com/developers/docs/interactions/slash-commands

The python example is

url = "https://discord.com/api/v8/applications/<my_application_id>/commands"

json = {
    "name": "blep",
    "description": "Send a random adorable animal photo",
    "options": [
        {
            "name": "animal",
            "description": "The type of animal",
            "type": 3,
            "required": True,
            "choices": [
                {
                    "name": "Dog",
                    "value": "animal_dog"
                },
                {
                    "name": "Cat",
                    "value": "animal_dog"
                },
                {
                    "name": "Penguin",
                    "value": "animal_penguin"
                }
            ]
        },
        {
            "name": "only_smol",
            "description": "Whether to show only baby animals",
            "type": 5,
            "required": False
        }
    ]
}

# For authorization, you can use either your bot token 
headers = {
    "Authorization": "Bot 123456"
}

# or a client credentials token for your app with the applications.commmands.update scope
headers = {
    "Authorization": "Bearer abcdefg"
}

r = requests.post(url, headers=headers, json=json)
@PixeLInc PixeLInc added the enhancement New feature or request label Dec 16, 2020
@swarley swarley self-assigned this Dec 16, 2020
@swarley swarley added this to Done in Interactions Dec 16, 2020
@swarley swarley moved this from Done to In progress in Interactions Dec 16, 2020
@swarley
Copy link
Member

swarley commented Dec 23, 2020

Anyone waiting for this feature can view our project for it to see the progress. I hope to get this finished by Jan 2021.

@swarley swarley mentioned this issue Aug 14, 2021
Interactions automation moved this from In progress to Done Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants