This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_functions.sk
249 lines (175 loc) · 8.25 KB
/
1_functions.sk
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
237
238
239
240
241
242
243
244
245
246
247
248
249
options:
bot: "DisTune"
footerText: "DisTune - A powerful Discord bot of your dreams."
icon: "https://cdn.discordapp.com/attachments/809401069489750057/947037864120680458/distune-new.png"
red: hex "ff0000"
blue: hex "0000ff"
green: hex "00ff00"
yellow: hex "ddff00"
orange: hex "ffb300"
aqua: hex "00fffb"
cyan: hex "1f9190"
black: hex "000000"
gray: hex "1c1b1b"
purple: hex "3640f6"
# Slash commands
# Command maker
function newSlash(n: string, d: string) :: object:
set {_nslash} to new slash command named "%{_n}%" with desc {_d}
return {_nslash}
# Options editor
function newOption_Slash_Set(v: object, n: string, d: string, t: string="string", o: boolean=false) :: slashoption:
if {_t} = "string":
if {_o} = false:
add required string option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add string option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "boolean":
if {_o} = false:
add required boolean option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add boolean option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "user":
if {_o} = false:
add required user option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add user option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "integer":
if {_o} = false:
add required integer option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add integer option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "number":
if {_o} = false:
add required number option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add number option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "channel":
if {_o} = false:
add required channel option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add channel option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "role":
if {_o} = false:
add required role option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add role option named "%{_n}%" with description "%{_d}%" to options of {_v}
function newOption_Slash(v: object, n: string, d: string, t: string="string", o: boolean=false):
if {_t} = "string":
if {_o} = false:
add required string option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add string option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "boolean":
if {_o} = false:
add required boolean option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add boolean option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "user":
if {_o} = false:
add required user option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add user option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "integer":
if {_o} = false:
add required integer option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add integer option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "number":
if {_o} = false:
add required number option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add number option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "channel":
if {_o} = false:
add required channel option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add channel option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "role":
if {_o} = false:
add required role option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add role option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "mentionable":
if {_o} = false:
add required mentionable option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add mentionable option named "%{_n}%" with description "%{_d}%" to options of {_v}
if {_t} = "attachment":
if {_o} = false:
add required attachment option named "%{_n}%" with description "%{_d}%" to options of {_v}
else:
add attachment option named "%{_n}%" with description "%{_d}%" to options of {_v}
# Subcommandsf
function newSubCmd_Slash(n: string, d: string) :: object:
set {_r} to new sub command named {_n} with description {_d}
return {_r}
function newSubGroup_Slash(n: string, d: string) :: object:
set {_r} to new slash command group named {_n} with description {_d}
return {_r} # t
function groupSub_Slash(c: object, s: object):
add {_s} to sub commands of {_c}
# Slash command adders
function addSlash_Local(slash: object, name: string):
delete {slashcmd.Local::%{_name}%}
set {slashcmd.Local::%{_name}%} to {_slash}
update command {slashcmd.Local::*} locally in guild with id "932659866110160936"
function addSlash_Local_GM(slash: object, name: string):
delete {slashcmd.LocalGM::%{_name}%}
set {slashcmd.LocalGM::%{_name}%} to {_slash}
update command {slashcmd.LocalGM::*} locally in guild with id "718519105644396694"
function addSlash_Global(slash: object, name: string):
delete {slashcmd.Global::%{_name}%}
set {slashcmd.Global::%{_name}%} to {_slash}
update command {slashcmd.Global::*} globally in bot {@bot}
function newChoice(v: object, n: string, d: string):
add new choice named "%{_n}%" with value "%{_d}%" to choices of {_v}
function newButton(r: object, t: string, id: string, n: string, e: string="none", d: boolean=false):
if {_t} = "primary":
if {_d} = false:
add new primary button with id {_id} named {_n} to components of {_r} if {_e} = "none"
add new primary button with id {_id} named {_n} with emoji {_e} to components of {_r} if {_e} != "none"
else:
add new disabled primary button with id {_id} named {_n} to components of {_r} if {_e} = "none"
add new disabled primary button with id {_id} named {_n} with emoji {_e} to components of {_r} if {_e} != "none"
if {_t} = "secondary":
if {_d} = false:
add new secondary button with id {_id} named {_n} to components of {_r} if {_e} = "none"
add new secondary button with id {_id} named {_n} with emoji {_e} to components of {_r} if {_e} != "none"
else:
add new disabled secondary button with id {_id} named {_n} to components of {_r} if {_e} = "none"
add new disabled secondary button with id {_id} named {_n} with emoji {_e} to components of {_r} if {_e} != "none"
if {_t} = "success":
if {_d} = false:
add new success button with id {_id} named {_n} to components of {_r} if {_e} = "none"
add new success button with id {_id} named {_n} with emoji {_e} to components of {_r} if {_e} != "none"
else:
add new disabled success button with id {_id} named {_n} to components of {_r} if {_e} = "none"
add new disabled success button with id {_id} named {_n} with emoji {_e} to components of {_r} if {_e} != "none"
if {_t} = "danger":
if {_d} = false:
add new danger button with id {_id} named {_n} to components of {_r} if {_e} = "none"
add new danger button with id {_id} named {_n} with emoji {_e} to components of {_r} if {_e} != "none"
else:
add new disabled danger button with id {_id} named {_n} to components of {_r} if {_e} = "none"
add new disabled danger button with id {_id} named {_n} with emoji {_e} to components of {_r} if {_e} != "none"
if {_t} = "link":
if {_d} = false:
add new link button with url {_id} named {_n} to components of {_r} if {_e} = "none"
else:
add new disabled link button with url {_id} named {_n} to components of {_r} if {_e} = "none"
# User app commands
function addUser_Local(cmd: object, name: string):
delete {usercmd.Local::%{_name}%}
set {usercmd.Local::%{_name}%} to {_cmd}
update command {usercmd.Local::*} locally in guild with id "932659866110160936"
function addUser_Global(cmd: object, name: string):
delete {usercmd.Global::%{_name}%}
set {usercmd.Global::%{_name}%} to {_cmd}
update command {usercmd.Global::*} globally in bot {@bot}
function newUserCmd(n: string) :: object:
set {_nuser} to new user command named "%{_n}%"
return {_nuser}
function dropdownMinMax(dd: dropdown, min: integer, max: integer):
set min range of {_dd} to {_min}
set max range of {_dd} to {_max}