Write a python discord bot that using / commands will send pictures from the imgur api,…
- User
Write a python discord bot that using / commands will send pictures from the imgur api, you have the bomb option if true 10 pictures wil be send and the type option which shouds send that specific type of chair if no type is selected it wil just send a regelur chair. I already made the commands:
import requests
url = "https://discord.com/api/v10/applications/{bot id}/commands"
json_data = { "name": "chair", "type": 1, "description": "Get a chair image", "options": [ { "name": "bomb", "description": "Bomb option", "type": 5, "required": False }, { "name": "type", "description": "Type of chair", "type": 3, "required": False, "choices": [ { "name": "massage chair", "value": "massage chair" }, { "name": "kitchen chair", "value": "kitchen chair" }, { "name": "comfy chair", "value": "comfy chair" } ] } ] }
For authorization, you can use either your bot token
headers = { "Authorization": "Bot {bot token}" }
or a client credentials token for your app with the applications.commands.update scope
headers = {
"Authorization": "Bearer <my_credentials_token>"
}
- Assistant
To implement the desired functionality, you'll need to use Discord's Python packages, such as discord.py and the command extension library discord-py-slash-command. First, you need to install both packages. You can install them using pip:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.