-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.json
236 lines (233 loc) · 10.6 KB
/
schema.json
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON schema for command.json files",
"type": "object",
"definitions": {
"subcommand": {
"type": "object",
"description": "Defines a new subcommand for this command.",
"anyOf": [{
"properties": {
"options": {
"type": "object",
"description": "The options for this subcommand",
"additionalProperties": {
"$ref": "#/definitions/option"
}
},
"description": {
"type": "string",
"description": "The description of this subcommand"
}
},
"required": ["options", "description"]
},
{
"properties": {
"subcommand": {
"const": true,
"description": "Whether this option is a subcommand or not"
},
"description": {
"type": "string",
"description": "The description of this subcommand"
}
},
"required": ["subcommand", "description"]
}
]
},
"option": {
"type": "object",
"description": "Defines a new option for this command.",
"required": [
"description"
],
"properties": {
"description": {
"type": "string",
"description": "The description of the option."
},
"required": {
"type": "boolean",
"description": "Whether this option is required or not."
},
"type": {
"type": "string",
"description": "The type of this option, not required if choices or channel_types is present.",
"anyOf": [
{ "const": "string", "description": "A string value" },
{ "const": "integer", "description": "A whole number (integer) value" },
{ "const": "number", "description": "A double number value" },
{ "const": "boolean", "description": "A boolean value (true or false)" },
{ "const": "user", "description": "Allows user to choose a user to target" },
{ "const": "channel", "description": "Allows user to choose a channel to target" },
{ "const": "role", "description": "Allows user to choose a role to target" },
{ "const": "mentionable", "description": "Allows user to target anything mentionable (i.e. users and roles)" }
]
},
"channel_types": {
"type": "array",
"description": "The list of valid channel types the user can choose if this option is a channel",
"uniqueItems": true,
"minItems": 1,
"maxItems": 11,
"items": {
"anyOf": [
{ "const": "text", "description": "A text channel within a server" },
{ "const": "dm", "description": "A direct message channel with a user" },
{ "const": "voice", "description": "A voice channel within a server" },
{ "const": "group_dm", "description": "A direct message channel with multiple users" },
{ "const": "category", "description": "A category channel containing many channels" },
{ "const": "announcements", "description": "An announcement channel on a server which can be followed" },
{ "const": "store", "description": "A channel for game developers to sell their games" },
{ "const": "announcement_thread", "description": "A thread channel created from an announcement channel" },
{ "const": "public_thread", "description": "A public thread channel created from a text channel" },
{ "const": "private_thread", "description": "A private thread channel created from a text channel" },
{ "const": "stage", "description": "A stage voice channel with speakers and an audience" }
]
}
},
"choices": {
"type": "object",
"description": "A list of choices the user can choose and their associated value. Please note that creating choices will not allow any other values!",
"additionalProperties": {
"anyOf": [{
"type": "string",
"description": "A choice with a string value"
},
{
"type": "number",
"description": "A choice with a number value"
}
]
}
},
"subcommand": {
"type": "boolean",
"description": "Whether this option is a subcommand. Not required if options is present."
},
"options": {
"type": "object",
"description": "A list of options for the subcommand.",
"additionalProperties": {
"$ref": "#/definitions/option"
}
},
"subcommands": {
"type": "object",
"description": "A list of subcommands in this subcommand group.",
"additionalProperties": {
"$ref": "#/definitions/subcommand"
}
},
"min": {
"type": "number",
"description": "The minimum value of this option (number and integer only)"
},
"max": {
"type": "number",
"description": "The maximum value of this option (number and integer only)"
}
}
},
"permission_list": {
"description": "A list of permissions required to use this command",
"type": "array",
"additionalItems": false,
"uniqueItems": true,
"minItems": 1,
"maxItems": 43,
"items": {
"anyOf": [
{ "const": "CreateInstantInvite" },
{ "const": "KickMembers" },
{ "const": "BanMembers" },
{ "const": "Administrator" },
{ "const": "ManageChannels" },
{ "const": "ManageGuild" },
{ "const": "AddReactions" },
{ "const": "ViewAuditLog" },
{ "const": "PrioritySpeaker" },
{ "const": "Stream" },
{ "const": "ViewChannel" },
{ "const": "SendMessages" },
{ "const": "SendTTSMessages" },
{ "const": "ManageMessages" },
{ "const": "EmbedLinks" },
{ "const": "AttachFiles" },
{ "const": "ReadMessageHistory" },
{ "const": "MentionEveryone" },
{ "const": "UseExternalEmojis" },
{ "const": "ViewGuildInsights" },
{ "const": "Connect" },
{ "const": "Speak" },
{ "const": "MuteMembers" },
{ "const": "DeafenMembers" },
{ "const": "MoveMembers" },
{ "const": "UseVAD" },
{ "const": "ChangeNickname" },
{ "const": "ManageNicknames" },
{ "const": "ManageRoles" },
{ "const": "ManageWebhooks" },
{ "const": "ManageEmojisAndStickers" },
{ "const": "UseApplicationCommands" },
{ "const": "RequestToSpeak" },
{ "const": "ManageEvents" },
{ "const": "ManageThreads" },
{ "const": "CreatePublicThreads" },
{ "const": "CreatePrivateThreads" },
{ "const": "UseExternalStickers" },
{ "const": "SendMessagesInThreads" },
{ "const": "UseEmbeddedActivities" },
{ "const": "ModerateMembers" }
]
}
}
},
"additionalProperties": {
"type": "object",
"description": "Defines a new slash command on Discord.",
"required": [
"description"
],
"properties": {
"description": {
"type": "string",
"description": "The description for the command, appears underneath the command on Discord."
},
"options": {
"type": "object",
"description": "A list of options the user can provide to the command.",
"additionalProperties": {
"$ref": "#/definitions/option"
}
},
"permissions": {
"description": "Specifies the command's permission in various aspects of Discord.",
"type": "object",
"properties": {
"disabled": {
"type": "boolean",
"default": false,
"description": "Is access to this command disabled by default?"
},
"dm": {
"type": "boolean",
"default": true,
"description": "Is this command allowed in DMs?"
},
"requires": {
"$ref": "#/definitions/permission_list"
}
}
}
}
},
"properties": {
"$schema": {
"type": "string",
"description": "The JSON schema for the commands.json file."
}
}
}