-
Notifications
You must be signed in to change notification settings - Fork 0
/
SkriptDocs.sk
507 lines (488 loc) · 26.4 KB
/
SkriptDocs.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
#Fix search on skripthub 21/02
#Fix filtering on skripthub 21/02
#Fixed search on skripthub 22/02
#Fixed filtering on skripthub 23/02
#Add an fallback if results wasn't found 23/02
#Added 23/02
#Added new commands 24/02
effect generate docs:
trigger:
delete {-docs::*}
delete {-skhubdocs::*}
send a http request to "https://api.skripttools.net/v4/documentation"
if last http response's code = 200:
map json of last http response's body to {-docs::*}
loop {-docs::data::*}:
if {-docs::data::%loop-index%::id} is set:
add 1 to {-docsamount}
else:
broadcast "An exception has occured while generating docs! %nl% %last http response's body%"
send a http request to "https://api.skripttools.net/v4/documentation/skripthub"
if last http response's code = 200:
map json of last http response's body to {-skhubdocs::*}
loop {-skhubdocs::*}:
if {-skhubdocs::%loop-index%::syntax_type} is set:
add 1 to {-skhubdocsamount}
else:
broadcast "An exception has occured while generating docs! %nl% %last http response's body%"
load:
load yaml "plugins/SkriptBot/bot.yml" as "bot"
if yaml "bot" is empty:
set yaml value "Bot.Token" from "bot" to "BotToken"
save yaml "bot"
"SkriptBot" is not loaded over discord
make new discord bot:
enable all default intents
login to "%yaml value "Bot.Token" from "bot"%" with name "SkriptBot"
generate docs
function DocsEmbed(docs: text, type: text, member: member, msg: message):
set {_realdocs} to {_docs}
set {_docs::*} to split {_docs} at ":"
if {_docs::1} is set:
set {_length} to length of {_docs::1}
if last 4 characters of {_docs::1} = "from":
if {_docs::2} is set:
set {_filter} to {_docs::2}
if {_length} > 4:
#broadcast "%length of {_docs::1}% %{_docs}%"
set {_realdocs} to first {_length} -4 characters of {_docs::1}
else:
set {_filteronly} to true
#broadcast "Tamanho: %{_length}%"
#broadcast "Pesquisa: %{_docs}%"
#broadcast "Filtro 1: %{_filter}%"
#broadcast "FilterOnly: %{_filteronly}%"
if {_type} = "sktools":
loop {-docs::data::*}:
set {_syntaxtype} to {-docs::data::%loop-index%::type}
set {_name} to {-docs::data::%loop-index%::name}
set {_addon} to {-docs::data::%loop-index%::addon}
set {_desc} to {-docs::data::%loop-index%::description}
#broadcast "Filter only é: %{_filteronly}%" if {_filteronly} is set
if {_filteronly} is true:
if "%{_addon}%" = "%{_filter}%":
broadcast "Addon: %{_addon}% faz parte do %{_filter}%"
if {_syntaxtype} = "events":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_events::*}
if {_syntaxtype} = "effects":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_effects::*}
if {_syntaxtype} = "sections":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_sections::*}
if {_syntaxtype} = "expressions":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_expressions::*}
if {_syntaxtype} = "conditions":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_conditions::*}
else:
if "%{_name}%%{_desc}%" contains "%{_realdocs}%":
if {_filter} is set:
if "%{_addon}%" = "%{_filter}%":
if {_syntaxtype} = "events":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_events::*}
if {_syntaxtype} = "effects":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_effects::*}
if {_syntaxtype} = "sections":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_sections::*} #Thats probably an innefficient way to do that but i couldn't think another way
if {_syntaxtype} = "expressions":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_expressions::*}
if {_syntaxtype} = "conditions":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_conditions::*}
else:
#broadcast "Filtro não ta setado%nL%Pesquisando sem ele!"
if {_syntaxtype} = "events":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_events::*}
broadcast "Evento encontrado"
if {_syntaxtype} = "effects":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_effects::*}
if {_syntaxtype} = "sections":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_sections::*}
if {_syntaxtype} = "expressions":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_expressions::*}
if {_syntaxtype} = "conditions":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_conditions::*}
if {_type} = "skhub":
loop {-skhubdocs::*}:
set {_syntaxtype} to {-skhubdocs::%loop-index%::syntax_type}
set {_name} to {-skhubdocs::%loop-index%::title}
set {_addon} to {-skhubdocs::%loop-index%::addon::name}
set {_desc} to {-skhubdocs::%loop-index%::description}
if {_filteronly} is true:
if "%{_addon}%" = "%{_filter}%":
if {_syntaxtype} = "event":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_events::*}
if {_syntaxtype} = "effect":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_effects::*}
if {_syntaxtype} = "section":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_sections::*}
if {_syntaxtype} = "expression":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_expressions::*}
if {_syntaxtype} = "condition":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_conditions::*}
else:
if "%{_name}%%{_desc}%" contains "%{_realdocs}%":
if {_filter} is set:
if "%{_addon}%" = "%{_filter}%":
if {_syntaxtype} = "event":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_events::*}
if {_syntaxtype} = "effect":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_effects::*}
if {_syntaxtype} = "section":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_sections::*} #Thats probably an innefficient way to do that but i couldn't think another way
if {_syntaxtype} = "expression":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_expressions::*}
if {_syntaxtype} = "condition":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_conditions::*}
else:
if {_syntaxtype} = "event":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_events::*}
if {_syntaxtype} = "effect":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_effects::*}
if {_syntaxtype} = "sections":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_sections::*}
if {_syntaxtype} = "expression":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_expressions::*}
if {_syntaxtype} = "condition":
add "%{_name}%|%{_addon}%|%{_desc} if {_desc} is set else "Click to show this documentation page"%" to {_conditions::*}
set {_b} to new embed
if {_events::*} is set:
if {_type} = "skhub":
set {_evtdropdown} to new dropdown with id "skhub:events"
else:
set {_evtdropdown} to new dropdown with id "sktools:events"
loop {_events::*}:
add 1 to {_eventscount}
set {_split::*} to split loop-value at "|"
set {_name} to {_split::1}
add "%{_name}%" to {_evns::*}
set {_addon} to {_split::2}
set {_desc} to first 100 characters of {_split::3}
if length of {_name} + length of {_addon} < 77:
add new choice with value "%discord id of {_member}%:%loop-index%" with name "%{_name}% (%{_addon}%)" with desc "%{_desc}%" with reaction "orange_book" to choices of {_evtdropdown}
else:
remove 1 from {_condcount}
if {_eventscount} >= 25:
stop loop
add inline field named "Events 📙" with value join {_evns::*} by nl to {_b}
set min range of {_evtdropdown} to 1
set max range of {_evtdropdown} to 1
set placeholder of {_evtdropdown} to "Select within %{_eventscount}% events 📙"
set {_events} to {_evtdropdown}
if {_effects::*} is set:
if {_type} = "skhub":
set {_evtdropdown} to new dropdown with id "skhub:effects"
else:
set {_evtdropdown} to new dropdown with id "sktools:effects"
loop {_effects::*}:
add 1 to {_effcount}
set {_split::*} to split loop-value at "|"
set {_name} to {_split::1}
add "%{_name}%" to {_eff::*}
set {_addon} to {_split::2}
set {_desc} to first 100 characters of {_split::3}
if length of {_name} + length of {_addon} < 80:
add new choice with value "%discord id of {_member}%:%loop-index%" with name "%{_name}% (%{_addon}%)" with desc "%{_desc}%" with reaction "blue_book" to choices of {_evtdropdown}
else:
remove 1 from {_condcount}
if {_effcount} >= 25:
stop loop
add inline field named "Effects 📘" with value join {_eff::*} by nl to {_b}
set min range of {_evtdropdown} to 1
set max range of {_evtdropdown} to 1
set placeholder of {_evtdropdown} to "Select within %{_effcount}% effects 📘"
set {_effects} to {_evtdropdown}
if {_expressions::*} is set:
if {_type} = "skhub":
set {_evtdropdown} to new dropdown with id "skhub:expressions"
else:
set {_evtdropdown} to new dropdown with id "sktools:expressions"
loop {_expressions::*}:
add 1 to {_exprcount}
set {_split::*} to split loop-value at "|"
set {_name} to {_split::1}
add "%{_name}%" to {_exprs::*}
set {_addon} to {_split::2}
set {_desc} to first 100 characters of {_split::3}
if length of {_name} + length of {_addon} < 80:
add new choice with value "%discord id of {_member}%:%loop-index%" with name "%{_name}% (%{_addon}%)" with desc "%{_desc}%" with reaction "green_book" to choices of {_evtdropdown}
else:
remove 1 from {_condcount}
if {_exprcount} >= 25:
stop loop
add inline field named "Expressions 📗" with value join {_exprs::*} by nl to {_b}
set min range of {_evtdropdown} to 1
set max range of {_evtdropdown} to 1
set placeholder of {_evtdropdown} to "Select within %{_exprcount}% expressions 📗"
set {_expressions} to {_evtdropdown}
if {_conditions::*} is set:
if {_type} = "skhub":
#broadcast "%{_conditions::*}%"
set {_evtdropdown} to new dropdown with id "skhub:conditions"
else:
set {_evtdropdown} to new dropdown with id "sktools:conditions"
loop {_conditions::*}:
add 1 to {_condcount}
set {_split::*} to split loop-value at "|"
set {_name} to {_split::1}
add "%{_name}%" to {_conds::*}
set {_addon} to {_split::2}
set {_desc} to first 100 characters of {_split::3}
if length of {_name} + length of {_addon} < 80:
add new choice with value "%discord id of {_member}%:%loop-index%" with name "%{_name}% (%{_addon}%)" with desc "%{_desc}%" with reaction "closed_book" to choices of {_evtdropdown}
else:
remove 1 from {_condcount}
if {_condcount} >= 25:
stop loop
add inline field named "Conditions 📕" with value join {_conds::*} by nl to {_b}
set min range of {_evtdropdown} to 1
set max range of {_evtdropdown} to 1
set placeholder of {_evtdropdown} to "Select within %{_condcount}% conditions 📕"
set {_conditions} to {_evtdropdown}
#if {_sections::*} is set:
# if {_type} = "skhub":
# set {_evtdropdown} to new dropdown with id "skhub:sections"
# else:
# set {_evtdropdown} to new dropdown with id "sktools:sections"
# loop {_sections::*}:
# add 1 to {_sectcount}
# set {_split::*} to split loop-value at "|"
# set {_name} to {_split::1}
# add "%{_name}%" to {_sects::*}
# set {_addon} to {_split::2}
# set {_desc} to first 100 characters of {_split::3}
# if length of {_name} + length of {_addon} < 80:
# add new choice with value loop-index with name "%{_name}% %{_addon}%" with desc "%{_desc}%" with reaction "bookmark" to choices of {_evtdropdown} #Exceded limit of rows to messages :(
# if {_sectcount} >= 25:
# stop loop
# add inline field named "Sections 📑" with value join {_sects::*} by nl to {_b}
# set min range of {_evtdropdown} to 1
# set max range of {_evtdropdown} to 1
# set placeholder of {_evtdropdown} to "Select within %{_sectcount}% sections 📑"
# set {_sections} to {_evtdropdown}
set {_amount} to {_effcount} + {_condcount} + {_exprcount} + {_eventscount} #+ {_sectcount}
set author of {_b} to "Found %{_amount}% syntaxes!"
set color of {_b} to color from rgb 255,165,0
if {_type} = "sktools":
if {_amount} = 0:
DocsEmbed("%{_realdocs}%", "skhub", {_member}, {_msg}) #Fallback to skripthub if no results was found on skripttools
stop
set {_skhub} to new buttons row
set {_arg} to {_docs}
replace all " " with "_" in {_arg}
replace all ":" with "|" in {_arg}
if length of {_arg} < 53:
add new button with url "skhub:%discord id of {_member}%:%{_arg}%" with style success with content "Search on SkriptHub" with reaction "green_book" to buttons of {_skhub}
add new button with url "suppress:%discord id of {_member}%" with style danger with content "Cancel" with reaction "x" to buttons of {_skhub}
set footer of {_b} to "Do not found what you were looking for? Try looking at skripthub docs!"
if discord id of member author of {_msg} != "942161118682550343":
reply to {_msg} with {_b} with bot "SkriptBot" with row {_events}, {_effects}, {_expressions}, {_conditions}, {_skhub}
else:
edit {_msg} to show {_b} with bot "SkriptBot"
set component of {_msg} to {_events}, {_effects}, {_expressions}, {_conditions}, {_skhub}
else if {_type} = "skhub":
if {_amount} > 1:
set {_buttons} to new buttons row
add new button with url "suppress:%discord id of {_member}%" with style danger with content "Cancel" with reaction "x" to buttons of {_buttons}
set footer of {_b} to "Showing results from skripthub docs!"
else:
set footer of {_b} to "Showing results from both skripttools & skripthub docs!"
set color of {_b} to color from rgb 0,255,0
if discord id of member author of {_msg} != "942161118682550343":
reply to {_msg} with {_b} with bot "SkriptBot" with row {_events}, {_effects}, {_expressions}, {_conditions}
#wait a tick
#add {_buttons} to components of {_msg} if {_amount} > 1
else:
edit {_msg} to show {_b} with bot "SkriptBot"
set component of {_msg} to {_events}, {_effects}, {_expressions}, {_conditions} and {_buttons}
#wait a tick
#add {_buttons} to components of {_msg} if {_amount} > 1
function DocsAnswer(name: text, type: text, member: member, msg: message):
set {_name::*} to split {_name} at "("
set {_name} to {_name::1}
set {_nameaddon} to {_name::2}
#broadcast "%{_name::2}%"
if {_type} = "sktools":
loop {-docs::data::*}:
set {_name2} to {-docs::data::%loop-index%::name}
set {_addon} to {-docs::data::%loop-index%::addon}
if "%{_name}%" = "%{_name2}% ":
if "%{_nameaddon}%" = "%{_addon}%)": #Avoiding conflicting syntaxes with same addon name
set {_syntaxtype} to {-docs::data::%loop-index%::type}
set {_desc} to {-docs::data::%loop-index%::description}
set {_patterns} to join {-docs::data::%loop-index%::patterns} with nl
set {_values} to join {-docs::data::%loop-index%::event_values} by "\n"
set {_examples} to join {-docs::data::%loop-index%::examples} with nl
set {_cancellable} to {-docs::data::%loop-index%::cancellable}
stop loop
if {_type} = "skhub":
loop {-skhubdocs::*}:
set {_name2} to {-skhubdocs::%loop-index%::title}
set {_addon} to {-skhubdocs::%loop-index%::addon::name} #Avoiding conflicting syntaxes with same addon name
if "%{_name}%" = "%{_name2}% ":
if "%{_nameaddon}%" = "%{_addon}%)":
set {_syntaxtype} to {-skhubdocs::%loop-index%::syntax_type}
set {_desc} to {-skhubdocs::%loop-index%::description}
set {_patterns} to join {-skhubdocs::%loop-index%::syntax_pattern} with nl
set {_values::*} to split {-skhubdocs::%loop-index%::event_values} at ","
#set {_examples} to join {skhubdocs::%loop-index%::examples} with nl #Skripthub api doesn't contains examples :(
set {_cancellable} to {-skhubdocs::%loop-index%::event_cancellable}
stop loop
#broadcast "Patterns: %{_patterns}%"
#broadcast "Desc: %{_desc}%"
#broadcast "Examples: %{_examples}%"
make embed:
set author of embed to "%{_name}% [%{_syntaxtype}%]"
set color of embed to orange
add ":pencil: **Patterns:** ```applescript%nl%%{_patterns}%```" to {_l::*}
if {_desc} is set:
if {_desc} is not "" or "null" or "<none>":
add ":file_folder: **Description:** %nl%*%{_desc}%*%nl%" to {_l::*}
if {_examples} is set:
add ":label: **Example(s):** ```applescript%nl%%{_examples}%%nl%```" to {_l::*}
if {_type} is "events" or "event" or "scopes" or "scope":
if {_values} is set:
add ":placard: **Possible Event-Values:**``` %{_values}% ```" to {_l::*}
if {_values::1} is set:
#broadcast "ta setado 2"
if "%{_values::1}%" doesn't contain "null" or "none" or "<none>":
add ":placard: **Possible Event-Values:**``` %join {_values::*} by nl%```" to {_l::*}
if {_syntaxtype} is "events" or "events":
if {_cancellable} is set:
if {_cancellable} is "0" or "false" or false:
add "**Cancealable Event** %mention tag of reaction "x"%" to {_l::*}
if {_cancellable} is "1" or "true" or true:
add "**Cancealable Event** %mention tag of reaction "white_check_mark"%" to {_l::*}
set description of embed to join {_l::*} with nl
add inline field named "Addon" with value "%{_addon}%" to embed
if {_type} = "sktools":
set footer of embed to "Powered by skripttools api"
if {_type} = "skhub":
set footer of embed to "Powered by skripthub api"
set timestamp of embed to now
edit {_msg} to show last embed
set {_buttons} to new buttons row
if length of {_name} < 51:
replace all " " with "_" in {_name}
replace all ":" with "|" in {_name}
add new button with url "back:%discord id of {_member}%:%{_type}%:%{_name}%" with style primary with content "Go Back" with reaction "arrow_backward" to buttons of {_buttons}
add new button with url "suppress:%discord id of {_member}%" with style danger with content "Cancel" with reaction "x" to buttons of {_buttons}
add {_buttons} to components of {_msg}
#Main docs command
discord command .d [<text>]:
aliases: docs
trigger:
if arg-1 is not set:
reply to event-message with "%mention tag of reaction "x"% You need to specify an argument to search over docs!" with bot "SkriptBot"
stop
DocsEmbed(arg-1, "sktools", event-member, event-message)
button click:
set {_id::*} to split event-button at ":"
if {_id::2} = discord id of event-member:
if {_id::2} = discord id of event-member:
replace all "_" with " " in {_id::4}
replace all "|" with ":" in {_id::4}
if last character of {_id::4} = " ":
set {_id::4} to subtext of "%{_id::4}%" from character 1 to (length of {_id::4} - 1)
DocsEmbed("%{_id::4}%", "%{_id::3}%", event-member, event-message)
if {_id::1} = "suppress":
#suppress embeds of event-message
destroy event-message
if {_id::1} = "skhub":
loop {_id::*}:
#broadcast "Loop-Value: %loop-value%"
add 1 to {_amount}
if {_amount} > 2:
set {_value} to loop-value
replace all "_" with " " in {_value}
replace all "|" with ":" in {_value}
add {_value} to {_test::*}
set {_answer} to "%{_test::*}%"
replace all "," and "and" with "" in {_answer}
#broadcast "Resposta: %{_answer}%"
DocsEmbed("%{_answer}%", "skhub", event-member, event-message)
else:
reply with hidden "Thats not your documentation interaction!"
dropdown interact:
set {_name::*} to split event-dropdown at ":"
set {_option} to event.getJDAEvent().getSelectedOptions().get(0)
set {_optionname} to {_option}.getLabel()
set {_optionid::*} to split {_option}.getValue() at ":"
if {_optionid::1} = discord id of event-member:
DocsAnswer({_optionname}, "%{_name::1}%", event-member, event-message)
else:
reply with hidden "Thats not your documentation interaction!"
#Some commands ported from Skript Bot#3042 from Big_Bad_E#1446
discord command .indent:
trigger:
set {_b} to new buttons row
add new link button with url "https://skripthub.net/tutorials/33" with style success with content "Indent" to buttons of {_b}
make embed:
set color of embed to color from rgb 0,255,0
set description of embed to "```css%nl%""Error: Indentation error at line X, expected X tabs/spaces, but found X tabs/spaces""```%nl%Or something similar, and you don't know how to fix it, read this tutorial at the button below."
set footer of embed to "Tutorial made by CharcoalToast"
set footer icon of embed to avatar of event-member
reply with last embed with row {_b} with bot "SkriptBot"
discord command .format:
trigger:
set {_msg} to "%referenced message of event-message%"
if {_msg} is not set:
make embed:
set title of embed to "Formatting Code In Discord"
add field named "Why?" with value "Code blocks make it easier for helpers to identify potential errors -- help them help you!" to embed
add inline field named "How it Looks" with value "\```on chat:%nl%broadcast ""This is how you format code!""```" to embed
add inline field named "The format" with value "```vb%nl%on chat:%nl%broadcast ""This is how you format code!""```" to embed
add field named "Extra Info" with value "On US keyboards, the grave character (`) is located above the tab key on the top left of the keyboard" to embed
set color of embed to color from rgb 0,255,0
reply to event-message with last embed with bot "SkriptBot"
stop
reply to event-message with "```vb%nl%%{_msg}%```" with bot "SkriptBot"
#Suggestion from AyhamAlali#0001 :)
discord command .docs-link:
trigger:
set {_b} to new buttons row
add new link button with url "https://docs.skunity.com/" with style danger with content "SkUnity Docs" with reaction "closed_book" to buttons of {_b}
add new link button with url "https://docs.skriptlang.org/" with style primary with content "SkriptLang Docs" with reaction "orange_book" to buttons of {_b}
add new link button with url "https://skripthub.net/docs/" with style success with content "SkriptHub Docs" with reaction "green_book" to buttons of {_b}
add new link button with url "https://skripttools.net/documentation" with style success with content "SkriptTools Docs" with reaction "orange_book" to buttons of {_b}
set {_builder} to a new message builder
append "Here's the list with the most known docs->%nl%%nl%" to {_builder}
append "**SkUnity** (Wrong and BaeFell and contributors)%nl%" to {_builder}
append "**SkriptLang** (SkriptLang Team)%nl%" to {_builder}
append "**SkriptHub** with over %{-skhubdocsamount}% syntaxes (eyesniper)%nl%" to {_builder}
append "**SkriptTools** with over %{-docsamount}% syntaxes (Deutro/SkUnity)" to {_builder}
make embed:
set description of embed to "%{_builder}%"
set color of embed to color from rgb 0,255,0
reply to event-message with last embed with bot "SkriptBot" with row {_b}
discord command .%:
aliases: percentsign
trigger:
set {_b} to a new message builder
append "**When should percent signs be used in Skript?**%nl%" to {_b}
append "In Skript, the purpose of surrounding an expression in %% signs is letting Skript know you want it to be parsed as an expression and insert its value into the string or variable you've put it in.organization a breeze. A list basically maps objects to their corresponding unique indices.%nl%%nl%" to {_b}
append "**Incorrect Usage:**%nl%" to {_b}
append "```vb%nl%give dirt to %%player%% %nl%send ""Hey there player"" to %%arg-1%% %nl%kill %%{_entity}%% %nL%```" to {_b}
append "**Correct Usage:**%nl%" to {_b}
append "```vb%nl%broadcast ""%%player%% has joined!"" %nl%send ""%%{_variable::*}%%"" to player%nl%set {_variable::%%uuid of player%%} to 10```" to {_b}
make embed:
set description of embed to "%{_b}%"
set footer of embed to "Percent signs (%%)"
set color of embed to color from rgb 0,255,0
reply to event-message with last embed with bot "SkriptBot"
discord command .tutorials:
aliases: t
trigger:
set {_b1} to new buttons row
set {_b2} to new buttons row
add new link button with url "https://skripthub.net/tutorials/17" with style primary with content "Getting Started" to buttons of {_b1}
add new link button with url "https://skripthub.net/tutorials/21" with style primary with content "Reading Syntaxes" to buttons of {_b1}
add new link button with url "https://skripthub.net/tutorials/33" with style primary with content "Indentations" to buttons of {_b1}
add new link button with url "https://skripthub.net/tutorials/35" with style primary with content "Conditions" to buttons of {_b1}
add new link button with url "https://skripthub.net/tutorials/43" with style primary with content "List Variables" to buttons of {_b1}
add new link button with url "https://skripthub.net/tutorials/50" with style primary with content "ScoreBoard" to buttons of {_b2}
add new link button with url "https://skripthub.net/tutorials/25" with style primary with content "Yaml" to buttons of {_b2}
add new link button with url "https://skripthub.net/tutorials/48" with style primary with content "Abilities" to buttons of {_b2}
add new link button with url "https://skripthub.net/tutorials/47" with style primary with content "Custom Crafts" to buttons of {_b2}
add new link button with url "https://skripthub.net/tutorials/51" with style primary with content "Custom Expressions" to buttons of {_b2}
make embed:
set description of embed to "Here's a list with many different tutorials%nl%From (SkriptHub)[https://skripthub.net/tutorials/]"
set color of embed to color from rgb 0,255,0
reply to event-message with last embed with bot "SkriptBot" with row {_b1}, {_b2}