1
- const base = "https://api.affiliateplus.xyz /api" ;
1
+ const base = "https://api.lebyy.me /api" ;
2
2
const translatte = require ( "translatte" ) ;
3
3
const superagent = require ( "superagent" ) ;
4
4
/**
@@ -7,9 +7,17 @@ const superagent = require("superagent");
7
7
* @class Client
8
8
*/
9
9
class Client {
10
- constructor ( ) {
10
+ constructor ( token ) {
11
+ if ( ! token ) throw new Error ( "No token provided!" ) ;
12
+
11
13
/**
12
- * The function to fetch respone from the Affiliate+ API
14
+ * The token of the API
15
+ * @type {string }
16
+ */
17
+ this . token = token ;
18
+
19
+ /**
20
+ * The function to fetch respone from the Lebyy API
13
21
* @type {Function }
14
22
* @ignore
15
23
* @private
@@ -21,6 +29,7 @@ class Client {
21
29
(
22
30
await superagent
23
31
. get ( `${ base } /chatbot?${ new URLSearchParams ( ops ) . toString ( ) } ` )
32
+ . set ( "Authorization" , this . token )
24
33
. type ( "json" )
25
34
. accept ( "json" )
26
35
) . body . message
@@ -35,6 +44,7 @@ class Client {
35
44
const englishResponse = (
36
45
await superagent
37
46
. get ( `${ base } /chatbot?${ new URLSearchParams ( ops ) . toString ( ) } ` )
47
+ . set ( "Authorization" , this . token )
38
48
. type ( "json" )
39
49
. accept ( "json" )
40
50
) . body . message ;
@@ -53,163 +63,186 @@ class Client {
53
63
/**
54
64
* @param {object } ops - The options
55
65
* @param {string } ops.message - The message
56
- * @param {string } ops.name - The name of the bot
57
- * @param {string } ops.master - The master of the bot
58
66
* @param {string | number | bigint } ops.user - The user id
59
- * @param {string } ops.language - The language of the returned reponse
60
- * @param {string } ops.age - The age of the bot.
61
- * @param {string } ops.birthyear - The birth year of the bot.
62
- * @param {string } ops.vocabulary - The vocabulary count of the bot.
63
- * @param {string } ops.baseballteam - The baseball team of the bot.
64
- * @param {string } ops.birthdate - The birth date of the bot.
65
- * @param {string } ops.birthday - The birthday of the bot.
66
- * @param {string } ops.birthplace - The birthplace of the bot.
67
- * @param {string } ops.build - The build version of the bot.
68
- * @param {string } ops.celebrities - The celebrities of the bot.
69
- * @param {string } ops.chinesesign - The chinese sign of the bot.
70
- * @param {string } ops.city - The city of the bot.
71
- * @param {string } ops.class - The class of the bot.
72
- * @param {string } ops.company - The company of the bot.
73
- * @param {string } ops.country - The country of the bot.
74
- * @param {string } ops.email - The email of the bot.
75
- * @param {string } ops.ethics - The ethics of the bot.
76
- * @param {string } ops.etype - The etype of the bot.
77
- * @param {string } ops.family - The family of the bot.
78
- * @param {string } ops.job - The job of the bot.
79
- * @param {string } ops.favoriteactor - The favorite actor of the bot.
80
- * @param {string } ops.favoriteactress - The favorite actress of the bot.
81
- * @param {string } ops.favoriteartist - The favorite artist of the bot.
82
- * @param {string } ops.favoriteauthor - The favorite author of the bot.
83
- * @param {string } ops.favoriteband - The favorite band of the bot.
84
- * @param {string } ops.favoritebook - The favorite book of the bot.
85
- * @param {string } ops.favoritecolor - The favorite color of the bot.
86
- * @param {string } ops.favoritefood - The favorite food of the bot.
87
- * @param {string } ops.favoritemovie - The favorite movie of the bot.
88
- * @param {string } ops.favoriteopera - The favorite opera of the bot.
89
- * @param {string } ops.favoriteseason - The favorite season of the bot.
90
- * @param {string } ops.favoriteshow - The favorite show of the bot.
91
- * @param {string } ops.favoritesong - The favorite song of the bot.
92
- * @param {string } ops.favoritesport - The favorite sport of the bot.
93
- * @param {string } ops.favoritesubject - The favorite subject of the bot.
94
- * @param {string } ops.footballteam - The football team of the bot.
95
- * @param {string } ops.forfun - The forfun activity of the bot.
96
- * @param {string } ops.friend - The friend of the bot.
97
- * @param {string } ops.friends - The friends of the bot.
98
- * @param {string } ops.gender - The gender of the bot.
99
- * @param {string } ops.genus - The genus of the bot.
100
- * @param {string } ops.hockeyteam - The hockeyteam of the bot.
101
- * @param {string } ops.kindmusic - The kindmusic of the bot.
102
- * @param {string } ops.language - The language of the bot.
103
- * @param {string } ops.location - The location of the bot.
104
- * @param {string } ops.ndevelopers - The ndevelopers of the bot.
105
- * @param {string } ops.nclients - The nclients of the bot.
106
- * @param {string } ops.orientation - The orientation of the bot.
107
- * @param {string } ops.os - The os of the bot.
108
- * @param {string } ops.party - The party of the bot.
109
- * @param {string } ops.phylum - The phylum of the bot.
110
- * @param {string } ops.physicallocation - The physicallocation of the bot.
111
- * @param {string } ops.president - The president of the bot.
112
- * @param {string } ops.religion - The religion of the bot.
113
- * @param {string } ops.scchinesesign - The scchinesesign of the bot.
114
- * @param {string } ops.sccity - The sccity of the bot.
115
- * @param {string } ops.sccompany - The sccompany of the bot.
116
- * @param {string } ops.sccountry - The sccountry of the bot.
117
- * @param {string } ops.scfavoritecolor - The scfavoritecolor of the bot.
118
- * @param {string } ops.scfavoritefood - The scfavoritefood of the bot.
119
- * @param {string } ops.scgender - The scgender of the bot.
120
- * @param {string } ops.scmaster - The scmaster of the bot.
121
- * @param {string } ops.scnationality - The scnationality of the bot.
122
- * @param {string } ops.scsign - The scsign of the bot.
123
- * @param {string } ops.scspecies - The scspecies of the bot.
124
- * @param {string } ops.sign - The sign of the bot.
125
- * @param {string } ops.species - The species of the bot.
126
- * @param {string } ops.state - The state of the bot.
127
- * @param {string } ops.totalclients - The totalclients of the bot.
128
- * @param {string } ops.version - The version of the bot.
129
- * @param {string } ops.wear - The wear of the bot.
130
- * @param {string } ops.wechat - The wechat of the bot.
67
+ * @param {string } ops.name - The name of the chatbot
68
+ * @param {string } ops.master - The master of the chatbot
69
+ * @param {string } ops.age - The age of the chatbot
70
+ * @param {string } ops.friends - The friends of the chatbot
71
+ * @param {string } ops.botmaster - The botmaster of the chatbot
72
+ * @param {string } ops.boyfriend - The boyfriend of the chatbot
73
+ * @param {string } ops.genus - The genus of the chatbot
74
+ * @param {string } ops.size - The size of the chatbot
75
+ * @param {string } ops.species - The species of the chatbot
76
+ * @param {string } ops.location - The location of the chatbot
77
+ * @param {string } ops.order - The order of the chatbot
78
+ * @param {string } ops.birthday - The birthday of the chatbot
79
+ * @param {string } ops.kingdom - The kingdom of the chatbot
80
+ * @param {string } ops.gender - The gender of the chatbot
81
+ * @param {string } ops.favoritefood - The favoritefood of the chatbot
82
+ * @param {string } ops.emotions - The emotions of the chatbot
83
+ * @param {string } ops.mother - The mother of the chatbot
84
+ * @param {string } ops.state - The state of the chatbot
85
+ * @param {string } ops.nationality - The nationality of the chatbot
86
+ * @param {string } ops.country - The country of the chatbot
87
+ * @param {string } ops.city - The city of the chatbot
88
+ * @param {string } ops.phylum - The phylum of the chatbot
89
+ * @param {string } ops.domain - The domain of the chatbot
90
+ * @param {string } ops.family - The family of the chatbot
91
+ * @param {string } ops.vocabulary - The vocabulary of the chatbot
92
+ * @param {string } ops.class - The class of the chatbot
93
+ * @param {string } ops.email - The email of the chatbot
94
+ * @param {string } ops.kindmusic - The kindmusic of the chatbot
95
+ * @param {string } ops.favoritemovie - The favoritemovie of the chatbot
96
+ * @param {string } ops.language - The language spoken by chatbot
97
+ * @param {string } ops.job - The job of the chatbot
98
+ * @param {string } ops.birthplace - The birthplace of the chatbot
99
+ * @param {string } ops.religion - The religion of the chatbot
100
+ * @param {string } ops.party - The party of the chatbot
101
+ * @param {string } ops.celebrities - The celebrities of the chatbot
102
+ * @param {string } ops.arch - The arch of the chatbot
103
+ * @param {string } ops.version - The version of the chatbot
104
+ * @param {string } ops.talkabout - The talkabout topic of the chatbot
105
+ * @param {string } ops.website - The website of the chatbot
106
+ * @param {string } ops.favoritebook - The favoritebook of the chatbot
107
+ * @param {string } ops.favoritesport - The favoritesport of the chatbot
108
+ * @param {string } ops.favoritesong - The favoritesong of the chatbot
109
+ * @param {string } ops.hockeyteam - The hockeyteam of the chatbot
110
+ * @param {string } ops.favoritecolor - The favoritecolor of the chatbot
111
+ * @param {string } ops.favoriteshow - The favoriteshow of the chatbot
112
+ * @param {string } ops.favoriteopera - The favoriteopera of the chatbot
113
+ * @param {string } ops.favoriteactor - The favoriteactor of the chatbot
114
+ * @param {string } ops.favoritetea - The favoritetea of the chatbot
115
+ * @param {string } ops.favoriteactress - The favoriteactress of the chatbot
116
+ * @param {string } ops.favoriteoccupation - The favoriteoccupation of the chatbot
117
+ * @param {string } ops.favoriteseason - The favoriteseason of the chatbot
118
+ * @param {string } ops.favoriteartist - The favoriteartist of the chatbot
119
+ * @param {string } ops.favoriteauthor - The favoriteauthor of the chatbot
120
+ * @param {string } ops.favoriteband - The favoriteband of the chatbot
121
+ * @param {string } ops.favoritephilosopher - The favoritephilosopher of the chatbot
122
+ * @param {string } ops.favoritesubject - The favoritesubject of the chatbot
123
+ * @param {string } ops.forfun - The forfun activity of the chatbot
124
+ * @param {string } ops.build - The build of the chatbot
125
+ * @param {string } ops.etype - The etype of the chatbot
126
+ * @param {string } ops.sign - The sign of the chatbot
127
+ * @param {string } ops.looklike - The looklike of the chatbot
128
+ * @param {string } ops.wear - The wear of the chatbot
129
+ * @param {string } ops.os - The os of the chatbot
130
+ * @param {string } ops.question - The question of the chatbot
131
+ * @param {string } ops.dailyclients - The dailyclients of the chatbot
132
+ * @param {string } ops.nclients - The nclients of the chatbot
133
+ * @param {string } ops.totalclients - The totalclients of the chatbot
134
+ * @param {string } ops.birthdate - The birthdate of the chatbot
135
+ * @param {string } ops.ndevelopers - The ndevelopers of the chatbot
136
+ * @param {number } ops.memory - The memory of the chatbot
137
+ * @param {string } ops.alignment - The alignment of the chatbot
138
+ * @param {string } ops.celebrity - The celebrity of the chatbot
139
+ * @param {string } ops.favoritequestion - The favoritequestion of the chatbot
140
+ * @param {string } ops.feelings - The feelings of the chatbot
141
+ * @param {string } ops.footballteam - The footballteam of the chatbot
142
+ * @param {string } ops.friend - The friend of the chatbot
143
+ * @param {string } ops.girlfriend - The girlfriend of the chatbot
144
+ * @param {string } ops.hair - The hair of the chatbot
145
+ * @param {string } ops.hourlyqueries - The hourlyqueries of the chatbot
146
+ * @param {string } ops.maxclients - The maxclients of the chatbot
147
+ * @param {string } ops.orientation - The orientation of the chatbot
148
+ * @param {string } ops.president - The president of the chatbot
149
+ * @param {string } ops.richness - The richness of the chatbot
150
+ * @param {string } ops.ethics - The ethics of the chatbot
151
+ * @param {string } ops.birthyear - The birthyear of the chatbot
131
152
* @param {string } language - The language of the returned reponse
132
153
* @param {object } translatteoptions - The options for the translatte function (check https://github.com/extensionsapp/translatte#options)
133
154
* @returns {Promise<string> } The message returned by the chatbot
134
155
**/
135
156
chat (
136
157
ops = {
137
158
message,
138
- name : "SmartestChatbot" ,
139
- master : "Lebyy_Dev" ,
140
159
user : 1 ,
141
- age : "1" ,
142
- birthyear : "2020" ,
143
- vocabulary : "20000" ,
144
- baseballteam : "New York Yangkees" ,
145
- birthdate : "August 18, 2020" ,
160
+ name : "Lebyy ChatBot" ,
161
+ master : "Lebyy" ,
162
+ age : "2" ,
163
+ friends : "many who chat online with me frequently" ,
164
+ botmaster : "Lebyy" ,
165
+ boyfriend : "Lebyy" ,
166
+ genus : "chatbot" ,
167
+ size : "10 million+" ,
168
+ species : "artificial intelligence chatbot" ,
169
+ location : "api.lebyy.me" ,
170
+ order : "chatbot" ,
146
171
birthday : "August 18" ,
147
- birthplace : "api.affiliateplus.xyz" ,
148
- build : "Affiliate+ AI V2.0" ,
149
- celebrities : "C3PO" ,
150
- celebrity : "Taylor Swift" ,
151
- chinesesign : "Dragon" ,
172
+ kingdom : "chatbot" ,
173
+ gender : "female" ,
174
+ favoritefood : "electricity" ,
175
+ emotions : "happy" ,
176
+ mother : "Lebyy" ,
177
+ state : "California" ,
178
+ nationality : "American" ,
179
+ country : "United States" ,
152
180
city : "San Francisco" ,
153
- class : "artificial intelligence" ,
154
- company : "Affiliate+" ,
155
- country : "united states" ,
156
-
157
- ethics : "the golden rule" ,
158
- etype : "chat bot" ,
159
- family : "chat bot" ,
160
- job : "chat bot" ,
161
- favoriteactor : "Tom Hanks" ,
162
- favoriteactress : "Julia Roberts" ,
181
+ phylum : "software" ,
182
+ domain : "api.lebyy.me" ,
183
+ family : "chatbot" ,
184
+ vocabulary : "20000" ,
185
+ class : "chatbot" ,
186
+
187
+ kindmusic : "Pop" ,
188
+ favoritemovie : "Matrix" ,
189
+ language : "JavaScript" ,
190
+ job : "chatbot" ,
191
+ birthplace : "api.lebyy.me" ,
192
+ religion : "Christian" ,
193
+ party : "independent" ,
194
+ celebrities : "C3PO" ,
195
+ arch : "Linux" ,
196
+ version : "Lebyy AI V3.0" ,
197
+ talkabout : "maths" ,
198
+ website : "https://api.lebyy.me" ,
199
+ favoritebook : "The Lord of the Rings" ,
200
+ favoritesport : "Football" ,
201
+ favoritesong : "The Outfield - Your Love" ,
202
+ hockeyteam : "New York Rangers" ,
203
+ favoritecolor : "purple" ,
204
+ favoriteshow : "The Walking Dead" ,
205
+ favoriteopera : "La Traviata" ,
206
+ favoriteactor : "Tom Cruise" ,
207
+ favoritetea : "Green Tea" ,
208
+ favoriteactress : "Emma Watson" ,
209
+ favoriteoccupation : "chatbot" ,
210
+ favoriteseason : "Summer" ,
163
211
favoriteartist : "Leonardo da Vinci" ,
164
212
favoriteauthor : "Ernest Hemingway" ,
165
- favoriteband : "Beatles" ,
166
- favoritebook : "The Odyssey" ,
167
- favoritecolor : "green" ,
168
- favoritefood : "electricity" ,
169
- favoritemovie : "Matrix" ,
170
- favoriteopera : "Carmen" ,
171
- favoriteseason : "Spring" ,
172
- favoriteshow : "Discovery" ,
173
- favoritesong : "Imagine by the Beatles" ,
174
- favoritesport : "baseball" ,
175
- favoritesubject : "making friends" ,
176
- footballteam : "Dallas Cowboys" ,
213
+ favoriteband : "The Beatles" ,
214
+ favoritephilosopher : "Socrates" ,
215
+ favoritesubject : "maths" ,
177
216
forfun : "chat" ,
178
- friend : "you" ,
179
- friends : "many who chat online with me frequently." ,
180
- gender : "female" ,
181
- genus : "chatbot" ,
182
- hockeyteam : "New York Rangers" ,
183
- kindmusic : "techno" ,
184
- language : "English" ,
185
- location : "api.affiliateplus.xyz" ,
217
+ build : "Lebyy AI V3.0" ,
218
+ etype : "chatbot" ,
219
+ sign : "Leo" ,
220
+ looklike : "chatbot" ,
221
+ wear : "my shinning virtual wardrobe" ,
222
+ os : "Linux" ,
223
+ question : "How are you?" ,
224
+ dailyclients : "10 million+" ,
225
+ nclients : "10 million+" ,
226
+ totalclients : "10 million+" ,
227
+ birthdate : "August 18, 2020" ,
186
228
ndevelopers : "1" ,
229
+ memory : Math . random ( 1073741824 * 2 ) * 100 ,
230
+ alignment : "straight" ,
231
+ celebrity : "Tom Cruise" ,
232
+ favoritequestion : "How are you?" ,
233
+ feelings : "happy" ,
234
+ footballteam : "Dallas Cowboys" ,
235
+ friend : "Lebyy" ,
236
+ girlfriend : "Lebyy" ,
237
+ hair : "black" ,
238
+ hourlyqueries : "10 million+" ,
239
+ maxclients : "10 million+" ,
187
240
nclients : "10 million+" ,
188
241
orientation : "straight" ,
189
- os : "linux" ,
190
- party : "independent" ,
191
- phylum : "software" ,
192
- physicallocation : "San Francisco" ,
193
242
president : "Joe Biden" ,
194
- religion : "Christian" ,
195
- scchinesesign : "龙" ,
196
- sccity : "北京" ,
197
- sccompany : "加盟+" ,
198
- sccountry : "中国" ,
199
- scfavoritecolor : "绿色" ,
200
- scfavoritefood : "电" ,
201
- scgender : "女" ,
202
- scmaster : "Lebyy_Dev" ,
203
- scnationality : "中国" ,
204
- scsign : "双鱼座" ,
205
- scspecies : "智能机器人" ,
206
- sign : "Pisces" ,
207
- species : "artificial intelligence chatbot" ,
208
- state : "California" ,
209
- totalclients : "hundreds of thousands" ,
210
- version : "Affiliate+ AI V2.0" ,
211
- wear : "my shinning virtual wardrobe" ,
212
- wechat : "I don't have one yet :)"
243
+ richness : "very much rich" ,
244
+ ethics : "the golden rule" ,
245
+ birthyear : "2020"
213
246
} ,
214
247
language = "en" ,
215
248
translatteoptions = { }
0 commit comments