-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interactions.py
51 lines (45 loc) · 1.27 KB
/
interactions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import os
import requests
from dotenv import load_dotenv
load_dotenv()
APPLICATION_ID = os.environ.get("APPLICATION_ID")
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN")
url = "https://discord.com/api/v8/applications/{}/guilds/444771470254669834/commands".format(APPLICATION_ID)
json = {
"name": "blep2",
"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_cat"
},
{
"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 {}".format(DISCORD_TOKEN)
}
r = requests.post(url, headers=headers, json=json)
print(r.json())