This repository has been archived by the owner on May 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathloriapi.html
178 lines (158 loc) · 5.01 KB
/
loriapi.html
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
{% extends 'base.html' %}
{% block subtitle %}Loritta API{% endblock %}
{% block body %}
<style>
body {
margin:0;
}
#loriDocs {
height: 100vh;
background-color: white;
}
.sidebar {
height: 100vh;
width: 25%;
overflow: auto;
background-color: rgb(243, 243, 244);
color: rgb(114, 118, 125);
font-family: Whitney,Helvetica Neue,Helvetica,Arial,sans-serif;
font-weight: 600;
float: left;
}
#documentationPanel {
width: 75%;
float: right;
color: #586069;
font-size: 14px;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
line-height: 1.35em;
height: 100vh;
overflow: auto;
}
#documentationWrapper {
margin: 1%;
}
.optionInfo {
text-align: center;
}
.entry {
padding: 5px;
}
.loriAngel {
height: 100%;
opacity: 0.25;
}
#hiddenDocs {
display: none;
}
.methodName {
font-size: 1.5em;
line-height: 1.5em;
}
.methodArguments {
color: #b10000;
}
.methodReturnType {
color: #00b198;
}
</style>
<script>
function loadDocumentation(name) {
$('#documentationWrapper').fadeOut(400, function() {
$('#documentationWrapper').html(document.getElementById(name).innerHTML);
$('#documentationWrapper').fadeIn(400);
});
}
</script>
{% macro generateDoc(clazz, id, docsAnnotation) %}
<div id="{{ id }}">
{% for method in clazz.getDeclaredMethods %}
{% set annotation = method.getAnnotation(docsAnnotation) %}
{% if annotation != null %}
<div class="methodName">{{ method.getName() }}(<span class="methodArguments">{% if annotation != null %}{{ annotation.arguments }}{% endif %}</span>) : <span class="methodReturnType">{{ method.getReturnType().getSimpleName() }}</span></div>
{{ annotation.description }}
</br>
<pre class="discordPre">
{{ annotation.example }}
</pre>
{% endif %}
{% endfor %}
</div>
{% endmacro %}
<div id="loriDocs">
<div class="sidebar">
<div class="entry" onclick="loadDocumentation('exampleHelloWorld');">Olá mundo!</div>
<div class="entry" onclick="loadDocumentation('exampleGiveRole');">Sistema básico de give role</div>
<div class="entry" onclick="loadDocumentation('exampleCats');">Gatinhos aleatórios</div>
<div class="entry" onclick="loadDocumentation('exampleFanArts');">Enviar uma imagem aleatória</div>
<hr>
{% for wrappers in nashClasses %}
<div class="entry" onclick="loadDocumentation('{{ wrappers.getId() }}');">{{ wrappers.getClazz().getSimpleName() }}</div>
{% endfor %}
</div>
<div id="documentationPanel">
<div id="documentationWrapper">
<div style="text-align: center;">
<img class="loriAngel" src="https://loritta.website/assets/img/loritta_angel_v2.png">
</div>
</div>
</div>
</div>
<div id="hiddenDocs">
<div id="exampleHelloWorld">
<p>Um exemplo bem básico da API, ao usar "comando", eu irei responder "Olá, eu me chamo Loritta" e, ao usar "comando fofa", eu irei responder "ownt~ 😊"</p>
<pre class="discordPre">
if (getArgument(0) == "fofa") { // Se o argumento 0 (ou seja, o primeiro argumento) for "fofa"...
reply("ownt~ 😊");
return;
}
reply("Olá, eu me chamo Loritta!");
</div>
<div id="exampleGiveRole">
<p>Um sistema básico de give role</p>
<pre class="discordPre">
var guild = getGuild(); // Pega a guild (servidor) atual
var role = guild.getRoleById("ID da Role"); // Pega a guild pelo ID (dica: Você pode usar o comando "roleid" para ver a ID da sua role!)
if (author().hasRole(role)) { // Se o usuário já tem a role...
author().removeRole(role); // Então vamos remover ela!
reply("Role removida! 😞");
} else { // Se não...
author().addRole(role); // Vamos adicionar a role!
reply("Role adicionada! 😊");
}
</pre>
</div>
<div id="exampleCats">
<p>Pega um gatinho aleatório do random.cat e envia no chat.</p>
<pre class="discordPre">
var conteudo = getURL("http://random.cat/meow"); // Pega o conteúdo de uma URL...
var json = JSON.parse(conteudo); // Transformamos ela em JSON...
reply("Olha, um gatinho fofinho para você! " + json["file"]);
</pre>
</div>
<div id="exampleFanArts">
<p>Envia uma imagem aleatória de uma lista!</p>
<pre class="discordPre">
var list = ["http://i.imgur.com/hxRTmHF.png", // Primeiro iremos criar uma lista com todas as nossas fan arts da Shantae
"http://i.imgur.com/Da8B9Jn.png",
"http://i.imgur.com/oRntw7X.jpg",
"http://i.imgur.com/nuXwUbv.jpg",
"http://i.imgur.com/3vsg9cY.png",
"http://i.imgur.com/W1VIEdL.jpg",
"http://i.imgur.com/EmxhIv5.jpg",
"http://i.imgur.com/1eZUIRa.png",
"http://i.imgur.com/injGJ4J.png",
"http://i.imgur.com/wmxcQBt.jpg",
"http://i.imgur.com/HLQFIj8.jpg",
"http://i.imgur.com/Gg4HdI3.jpg"]
var rand = list[Math.floor(Math.random() * list.length)]; // Pegamos uma imagem aleatória da lista...
reply(rand);
</pre>
</div>
{% for wrappers in nashClasses %}
{{ generateDoc(wrappers.getClazz(), wrappers.getId(), docsAnnotation) }}
{% endfor %}
</div>
</div>
<link async rel="stylesheet" type="text/css" href="{{ websiteUrl }}assets/style.css?v=1.1">
{% endblock %}