-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathai.html
158 lines (135 loc) · 4.94 KB
/
ai.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
<div class="target-padding">
<h1>Artificial intelligence (AI)</h1>
<div class="subcontent">
<p>
<h2>What is AI (Artificial intelligence)?</h2>
<div class="subcontent">
Origem Bot brain has been updated to next level. Now is Origem Bot like real man! You can talk with your BOT about whatever! Ask him, reply him, tell him.. @Mention isn't required!*
</div>
</p>
<p>
<h2>What do you need to know before start?</h2>
<div class="subcontent">
<b>If you use PUBLIC AI</b>:<br>
- nothing, only set in <b>Origem Bot Control Palen</b> AI to <b>public</b><br>
Public AI is connected to CLEVERBOT.<br>
<br>
<b>If you use PRIVATE AI</b><br>
<span style="color:#FF8585">- you must know what is JSON</span><br>
If you don't know, what is JSON, please don't set in CPANEL private AI type. With wrong syntax AI will not working and Origem Bot atuomatically load DEFAULT AI file.
</div>
<h2>JSON file example (default AI file)</h2>
<div class="subcontent">
<div id="ai_code_example_container">
<pre id="ai_code_example"></pre>
<div id="ai_code_toggleHeight">Show more</div>
</div>
</div>
<h2>Definition</h2>
<div class="subcontent">
<b>onMention</b>: Origem Bot reply from this when you @mention to bot <i>(only first time, read more below*)</i><br>
<b>offMention</b>: Origem Bot reply from this everytime. It's recommeded add here only messages like greeting (hi, hello, bye, cya, brb, afk ..)<br>
<b>global</b>: Origem Bot reply from this when Origem Bot can't find match message in <b>onMention</b> and <b>offMention</b> and BOT is mentioned.<br><br>
<b>msgType</b> is type of message. Available options is only "<b>contains</b>" and "<b>mustBe</b>".<br>
<b>msgContains</b> is <b>Array</b> with <b>strings</b>. If Origem Bot find one from this strings, Origem Bot automatically reply random string from <b>botReply</b> array.<br>
<b>botReply</b> is <b>Array</b> with <b>strings</b> what Origem Bot reply.<br><br>
<b>msgType: "<u>contains</u>"</b> - Origem Bot reply random message from <b>botReply</b>, where <b>message contains whatever</b> from <b>msgContains</b> array.<br>
<b>msgType: "<u>mustBe</u>"</b> - Origem Bot reply random message from <b>botReply</b>, where <b>message is 100% match</b> one from <b>msgContains</b> array.<br>
<br>
<i>*Mention isn't required only when you are last person who talking with BOT. Only first mention is required. When somebody else post message in chat, you must @mention Origem Bot again.</i><br><br>
</div>
<h2>Where I can upload my JSON file?</h2>
<div class="subcontent">
In Origem Bot CPANEL you can use any URL. You can upload it where you want. Server, where you upload the file, must have SSL (<span style="color:#6AD478">https</span>://)! I recommend upload this file to your github and use RAW url.<br><br>
</div>
</p>
</div>
</div>
<script>
function output(inp) {
$("#ai_code_example").html(inp);
}
function syntaxHighlight(json) {
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
var cls = 'number';
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = 'key';
} else {
cls = 'string';
}
} else if (/true|false/.test(match)) {
cls = 'boolean';
} else if (/null/.test(match)) {
cls = 'null';
}
return '<span class="' + cls + '">' + match + '</span>';
});
}
$(document).ready(function(){
var obj = {
"onMention": [
{
"msgType": "contains",
"msgContains": [
"green",
"blue",
"red",
"orange"
],
"botReply": [
"that is color!"
]
},
{
"msgType": "contains",
"msgContains": [
"Origem Bot"
],
"botReply": [
"Origem Bot is your virtual dog",
"Origem Bot is so cute",
"Origem Bot loves you",
"Origem Bot likes you",
"Origem Bot is chat-bot",
"yes?"
]
},
{
"msgType": "mustBe",
"msgContains": [
"copy this message to chat"
],
"botReply": [
"You writed \"copy this message to chat\"!"
]
}
],
"offMention": [
{
"msgContains": [
"hi",
"hello"
],
"botReply": [
"hello!",
"hay!",
"welcome! \\o"
]
}
],
"global": [
"I'm BOT, please don't talk to me :(",
"I said, don't talk to me!",
"I dont understand. Please contact Staff!"
]
};
var str = JSON.stringify(obj, undefined, 4);
output(syntaxHighlight(str));
$("#ai_code_toggleHeight").click(function(){
$(this).remove();
$("#ai_code_example").css("height", "auto");
})
});
</script>