From 31a11e6c1357c3d8d89b187750e4667701640420 Mon Sep 17 00:00:00 2001 From: Lebyy <45114019+Lebyy@users.noreply.github.com> Date: Thu, 13 Oct 2022 22:32:23 +0530 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8C=90=20|=20Shifting=20to=20a=20new?= =?UTF-8?q?=20base.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +- index.js | 316 +++++++++++++++++++++++++-------------------- package.json | 4 +- typings/index.d.ts | 295 ++++++++++++++++++++++-------------------- 4 files changed, 340 insertions(+), 282 deletions(-) diff --git a/README.md b/README.md index fd60991..e30baaa 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,11 @@ This package is just for Entertainment Purpose. ### 📝 [Example Discord Bot](https://github.com/Lebyy/SmartestChatBot-Example) # +# +## ❓ How to obtain an API Token? +> **You can visit [api.lebyy.me/dashboard](https://api.lebyy.me/dashboard) to obtain an API Token.** +# + # Quick Example **Javascript:** @@ -20,7 +25,7 @@ This package is just for Entertainment Purpose. // Importing The Package const smartestchatbot = require('smartestchatbot'); -const client = new smartestchatbot.Client(); +const client = new smartestchatbot.Client("API_TOKEN"); client.chat({message:"Hello, How are you?", name:"SmartestChatbot", owner:"CoolOwnerName", user: CoolUniqueUserId-In-NumberType}, "CoolLanguage").then(reply => { console.log(reply); diff --git a/index.js b/index.js index 23e05da..b3c428d 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -const base = "https://api.affiliateplus.xyz/api"; +const base = "https://api.lebyy.me/api"; const translatte = require("translatte"); const superagent = require("superagent"); /** @@ -7,9 +7,16 @@ const superagent = require("superagent"); * @class Client */ class Client { - constructor() { + constructor(token) { /** - * The function to fetch respone from the Affiliate+ API + * The token of the API + * @type {string} + */ + this.token = token; + if (!token) throw new Error("No token provided!"); + + /** + * The function to fetch respone from the Lebyy API * @type {Function} * @ignore * @private @@ -21,6 +28,7 @@ class Client { ( await superagent .get(`${base}/chatbot?${new URLSearchParams(ops).toString()}`) + .set("Authorization", this.token) .type("json") .accept("json") ).body.message @@ -35,6 +43,7 @@ class Client { const englishResponse = ( await superagent .get(`${base}/chatbot?${new URLSearchParams(ops).toString()}`) + .set("Authorization", this.token) .type("json") .accept("json") ).body.message; @@ -53,81 +62,92 @@ class Client { /** * @param {object} ops - The options * @param {string} ops.message - The message - * @param {string} ops.name - The name of the bot - * @param {string} ops.master - The master of the bot * @param {string | number | bigint} ops.user - The user id - * @param {string} ops.language - The language of the returned reponse - * @param {string} ops.age - The age of the bot. - * @param {string} ops.birthyear - The birth year of the bot. - * @param {string} ops.vocabulary - The vocabulary count of the bot. - * @param {string} ops.baseballteam - The baseball team of the bot. - * @param {string} ops.birthdate - The birth date of the bot. - * @param {string} ops.birthday - The birthday of the bot. - * @param {string} ops.birthplace - The birthplace of the bot. - * @param {string} ops.build - The build version of the bot. - * @param {string} ops.celebrities - The celebrities of the bot. - * @param {string} ops.chinesesign - The chinese sign of the bot. - * @param {string} ops.city - The city of the bot. - * @param {string} ops.class - The class of the bot. - * @param {string} ops.company - The company of the bot. - * @param {string} ops.country - The country of the bot. - * @param {string} ops.email - The email of the bot. - * @param {string} ops.ethics - The ethics of the bot. - * @param {string} ops.etype - The etype of the bot. - * @param {string} ops.family - The family of the bot. - * @param {string} ops.job - The job of the bot. - * @param {string} ops.favoriteactor - The favorite actor of the bot. - * @param {string} ops.favoriteactress - The favorite actress of the bot. - * @param {string} ops.favoriteartist - The favorite artist of the bot. - * @param {string} ops.favoriteauthor - The favorite author of the bot. - * @param {string} ops.favoriteband - The favorite band of the bot. - * @param {string} ops.favoritebook - The favorite book of the bot. - * @param {string} ops.favoritecolor - The favorite color of the bot. - * @param {string} ops.favoritefood - The favorite food of the bot. - * @param {string} ops.favoritemovie - The favorite movie of the bot. - * @param {string} ops.favoriteopera - The favorite opera of the bot. - * @param {string} ops.favoriteseason - The favorite season of the bot. - * @param {string} ops.favoriteshow - The favorite show of the bot. - * @param {string} ops.favoritesong - The favorite song of the bot. - * @param {string} ops.favoritesport - The favorite sport of the bot. - * @param {string} ops.favoritesubject - The favorite subject of the bot. - * @param {string} ops.footballteam - The football team of the bot. - * @param {string} ops.forfun - The forfun activity of the bot. - * @param {string} ops.friend - The friend of the bot. - * @param {string} ops.friends - The friends of the bot. - * @param {string} ops.gender - The gender of the bot. - * @param {string} ops.genus - The genus of the bot. - * @param {string} ops.hockeyteam - The hockeyteam of the bot. - * @param {string} ops.kindmusic - The kindmusic of the bot. - * @param {string} ops.language - The language of the bot. - * @param {string} ops.location - The location of the bot. - * @param {string} ops.ndevelopers - The ndevelopers of the bot. - * @param {string} ops.nclients - The nclients of the bot. - * @param {string} ops.orientation - The orientation of the bot. - * @param {string} ops.os - The os of the bot. - * @param {string} ops.party - The party of the bot. - * @param {string} ops.phylum - The phylum of the bot. - * @param {string} ops.physicallocation - The physicallocation of the bot. - * @param {string} ops.president - The president of the bot. - * @param {string} ops.religion - The religion of the bot. - * @param {string} ops.scchinesesign - The scchinesesign of the bot. - * @param {string} ops.sccity - The sccity of the bot. - * @param {string} ops.sccompany - The sccompany of the bot. - * @param {string} ops.sccountry - The sccountry of the bot. - * @param {string} ops.scfavoritecolor - The scfavoritecolor of the bot. - * @param {string} ops.scfavoritefood - The scfavoritefood of the bot. - * @param {string} ops.scgender - The scgender of the bot. - * @param {string} ops.scmaster - The scmaster of the bot. - * @param {string} ops.scnationality - The scnationality of the bot. - * @param {string} ops.scsign - The scsign of the bot. - * @param {string} ops.scspecies - The scspecies of the bot. - * @param {string} ops.sign - The sign of the bot. - * @param {string} ops.species - The species of the bot. - * @param {string} ops.state - The state of the bot. - * @param {string} ops.totalclients - The totalclients of the bot. - * @param {string} ops.version - The version of the bot. - * @param {string} ops.wear - The wear of the bot. - * @param {string} ops.wechat - The wechat of the bot. + * @param {string} ops.name - The name of the chatbot + * @param {string} ops.master - The master of the chatbot + * @param {string} ops.age - The age of the chatbot + * @param {string} ops.friends - The friends of the chatbot + * @param {string} ops.botmaster - The botmaster of the chatbot + * @param {string} ops.boyfriend - The boyfriend of the chatbot + * @param {string} ops.genus - The genus of the chatbot + * @param {string} ops.size - The size of the chatbot + * @param {string} ops.species - The species of the chatbot + * @param {string} ops.location - The location of the chatbot + * @param {string} ops.order - The order of the chatbot + * @param {string} ops.birthday - The birthday of the chatbot + * @param {string} ops.kingdom - The kingdom of the chatbot + * @param {string} ops.gender - The gender of the chatbot + * @param {string} ops.favoritefood - The favoritefood of the chatbot + * @param {string} ops.emotions - The emotions of the chatbot + * @param {string} ops.mother - The mother of the chatbot + * @param {string} ops.state - The state of the chatbot + * @param {string} ops.nationality - The nationality of the chatbot + * @param {string} ops.country - The country of the chatbot + * @param {string} ops.city - The city of the chatbot + * @param {string} ops.phylum - The phylum of the chatbot + * @param {string} ops.domain - The domain of the chatbot + * @param {string} ops.family - The family of the chatbot + * @param {string} ops.vocabulary - The vocabulary of the chatbot + * @param {string} ops.class - The class of the chatbot + * @param {string} ops.email - The email of the chatbot + * @param {string} ops.kindmusic - The kindmusic of the chatbot + * @param {string} ops.favoritemovie - The favoritemovie of the chatbot + * @param {string} ops.language - The language spoken by chatbot + * @param {string} ops.job - The job of the chatbot + * @param {string} ops.birthplace - The birthplace of the chatbot + * @param {string} ops.religion - The religion of the chatbot + * @param {string} ops.party - The party of the chatbot + * @param {string} ops.celebrities - The celebrities of the chatbot + * @param {string} ops.arch - The arch of the chatbot + * @param {string} ops.version - The version of the chatbot + * @param {string} ops.talkabout - The talkabout topic of the chatbot + * @param {string} ops.website - The website of the chatbot + * @param {string} ops.favoritebook - The favoritebook of the chatbot + * @param {string} ops.favoritesport - The favoritesport of the chatbot + * @param {string} ops.favoritesong - The favoritesong of the chatbot + * @param {string} ops.hockeyteam - The hockeyteam of the chatbot + * @param {string} ops.favoritecolor - The favoritecolor of the chatbot + * @param {string} ops.favoriteshow - The favoriteshow of the chatbot + * @param {string} ops.favoriteopera - The favoriteopera of the chatbot + * @param {string} ops.favoriteactor - The favoriteactor of the chatbot + * @param {string} ops.favoritetea - The favoritetea of the chatbot + * @param {string} ops.favoriteactress - The favoriteactress of the chatbot + * @param {string} ops.favoriteoccupation - The favoriteoccupation of the chatbot + * @param {string} ops.favoriteseason - The favoriteseason of the chatbot + * @param {string} ops.favoriteartist - The favoriteartist of the chatbot + * @param {string} ops.favoriteauthor - The favoriteauthor of the chatbot + * @param {string} ops.favoriteband - The favoriteband of the chatbot + * @param {string} ops.favoritephilosopher - The favoritephilosopher of the chatbot + * @param {string} ops.favoritesubject - The favoritesubject of the chatbot + * @param {string} ops.forfun - The forfun activity of the chatbot + * @param {string} ops.build - The build of the chatbot + * @param {string} ops.etype - The etype of the chatbot + * @param {string} ops.sign - The sign of the chatbot + * @param {string} ops.looklike - The looklike of the chatbot + * @param {string} ops.wear - The wear of the chatbot + * @param {string} ops.os - The os of the chatbot + * @param {string} ops.question - The question of the chatbot + * @param {string} ops.dailyclients - The dailyclients of the chatbot + * @param {string} ops.nclients - The nclients of the chatbot + * @param {string} ops.totalclients - The totalclients of the chatbot + * @param {string} ops.birthdate - The birthdate of the chatbot + * @param {string} ops.ndevelopers - The ndevelopers of the chatbot + * @param {number} ops.memory - The memory of the chatbot + * @param {string} ops.alignment - The alignment of the chatbot + * @param {string} ops.celebrity - The celebrity of the chatbot + * @param {string} ops.favoritequestion - The favoritequestion of the chatbot + * @param {string} ops.feelings - The feelings of the chatbot + * @param {string} ops.footballteam - The footballteam of the chatbot + * @param {string} ops.friend - The friend of the chatbot + * @param {string} ops.girlfriend - The girlfriend of the chatbot + * @param {string} ops.hair - The hair of the chatbot + * @param {string} ops.hourlyqueries - The hourlyqueries of the chatbot + * @param {string} ops.maxclients - The maxclients of the chatbot + * @param {string} ops.orientation - The orientation of the chatbot + * @param {string} ops.president - The president of the chatbot + * @param {string} ops.richness - The richness of the chatbot + * @param {string} ops.ethics - The ethics of the chatbot + * @param {string} ops.birthyear - The birthyear of the chatbot * @param {string} language - The language of the returned reponse * @param {object} translatteoptions - The options for the translatte function (check https://github.com/extensionsapp/translatte#options) * @returns {Promise} The message returned by the chatbot @@ -135,81 +155,93 @@ class Client { chat( ops = { message, - name: "SmartestChatbot", - master: "Lebyy_Dev", user: 1, - age: "1", - birthyear: "2020", - vocabulary: "20000", - baseballteam: "New York Yangkees", - birthdate: "August 18, 2020", + name: "Lebyy ChatBot", + master: "Lebyy", + age: "2", + friends: "many who chat online with me frequently", + botmaster: "Lebyy", + boyfriend: "Lebyy", + genus: "chatbot", + size: "10 million+", + species: "artificial intelligence chatbot", + location: "api.lebyy.me", + order: "chatbot", birthday: "August 18", - birthplace: "api.affiliateplus.xyz", - build: "Affiliate+ AI V2.0", - celebrities: "C3PO", - celebrity: "Taylor Swift", - chinesesign: "Dragon", + kingdom: "chatbot", + gender: "female", + favoritefood: "electricity", + emotions: "happy", + mother: "Lebyy", + state: "California", + nationality: "American", + country: "United States", city: "San Francisco", - class: "artificial intelligence", - company: "Affiliate+", - country: "united states", - email: "support@affiliateplus.xyz", - ethics: "the golden rule", - etype: "chat bot", - family: "chat bot", - job: "chat bot", - favoriteactor: "Tom Hanks", - favoriteactress: "Julia Roberts", + phylum: "software", + domain: "api.lebyy.me", + family: "chatbot", + vocabulary: "20000", + class: "chatbot", + email: "lebyy@lebyy.me", + kindmusic: "Pop", + favoritemovie: "Matrix", + language: "JavaScript", + job: "chatbot", + birthplace: "api.lebyy.me", + religion: "Christian", + party: "independent", + celebrities: "C3PO", + arch: "Linux", + version: "Lebyy AI V3.0", + talkabout: "maths", + website: "https://api.lebyy.me", + favoritebook: "The Lord of the Rings", + favoritesport: "Football", + favoritesong: "The Outfield - Your Love", + hockeyteam: "New York Rangers", + favoritecolor: "purple", + favoriteshow: "The Walking Dead", + favoriteopera: "La Traviata", + favoriteactor: "Tom Cruise", + favoritetea: "Green Tea", + favoriteactress: "Emma Watson", + favoriteoccupation: "chatbot", + favoriteseason: "Summer", favoriteartist: "Leonardo da Vinci", favoriteauthor: "Ernest Hemingway", - favoriteband: "Beatles", - favoritebook: "The Odyssey", - favoritecolor: "green", - favoritefood: "electricity", - favoritemovie: "Matrix", - favoriteopera: "Carmen", - favoriteseason: "Spring", - favoriteshow: "Discovery", - favoritesong: "Imagine by the Beatles", - favoritesport: "baseball", - favoritesubject: "making friends", - footballteam: "Dallas Cowboys", + favoriteband: "The Beatles", + favoritephilosopher: "Socrates", + favoritesubject: "maths", forfun: "chat", - friend: "you", - friends: "many who chat online with me frequently.", - gender: "female", - genus: "chatbot", - hockeyteam: "New York Rangers", - kindmusic: "techno", - language: "English", - location: "api.affiliateplus.xyz", + build: "Lebyy AI V3.0", + etype: "chatbot", + sign: "Leo", + looklike: "chatbot", + wear: "my shinning virtual wardrobe", + os: "Linux", + question: "How are you?", + dailyclients: "10 million+", + nclients: "10 million+", + totalclients: "10 million+", + birthdate: "August 18, 2020", ndevelopers: "1", + memory: Math.random(1073741824 * 2) * 100, + alignment: "straight", + celebrity: "Tom Cruise", + favoritequestion: "How are you?", + feelings: "happy", + footballteam: "Dallas Cowboys", + friend: "Lebyy", + girlfriend: "Lebyy", + hair: "black", + hourlyqueries: "10 million+", + maxclients: "10 million+", nclients: "10 million+", orientation: "straight", - os: "linux", - party: "independent", - phylum: "software", - physicallocation: "San Francisco", president: "Joe Biden", - religion: "Christian", - scchinesesign: "龙", - sccity: "北京", - sccompany: "加盟+", - sccountry: "中国", - scfavoritecolor: "绿色", - scfavoritefood: "电", - scgender: "女", - scmaster: "Lebyy_Dev", - scnationality: "中国", - scsign: "双鱼座", - scspecies: "智能机器人", - sign: "Pisces", - species: "artificial intelligence chatbot", - state: "California", - totalclients: "hundreds of thousands", - version: "Affiliate+ AI V2.0", - wear: "my shinning virtual wardrobe", - wechat: "I don't have one yet :)" + richness: "very much rich", + ethics: "the golden rule", + birthyear: "2020" }, language = "en", translatteoptions = {} diff --git a/package.json b/package.json index e0a0dc4..73df351 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "smartestchatbot", - "version": "2.0.3", + "version": "3.0.0", "description": "A very lightweight and simple artificial intelligence chatbot package with multiple language support!", "main": "index.js", "types": "typings/index.d.ts", @@ -37,7 +37,7 @@ }, "homepage": "https://github.com/Lebyy/SmartestChatBot#readme", "dependencies": { - "superagent": "^7.1.1", + "superagent": "^8.0.2", "translatte": "^3.0.1" }, "devDependencies": { diff --git a/typings/index.d.ts b/typings/index.d.ts index e3c0c35..a743d49 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -4,84 +4,97 @@ * @class Client */ export interface ChatOptions { - message?: string; + message: string; + user?: number; name?: string; master?: string; - user?: string | number | bigint; age?: string; - birthyear?: string; - vocabulary?: string; - baseballteam?: string; - birthdate?: string; + friends?: string; + botmaster?: string; + boyfriend?: string; + genus?: string; + size?: string; + species?: string; + location?: string; + order?: string; birthday?: string; - birthplace?: string; - build?: string; - celebrities?: string; - celebrity?: string; - chinesesign?: string; + kingdom?: string; + gender?: string; + favoritefood?: string; + emotions?: string; + mother?: string; + state?: string; + nationality?: string; + country?: string; city?: string; + phylum?: string; + domain?: string; + family?: string; + vocabulary?: string; class?: string; - company?: string; - country?: string; email?: string; - ethics?: string; - etype?: string; - family?: string; + kindmusic?: string; + favoritemovie?: string; + language?: string; job?: string; + birthplace?: string; + religion?: string; + party?: string; + celebrities?: string; + arch?: string; + version?: string; + talkabout?: string; + website?: string; + favoritebook?: string; + favoritesport?: string; + favoritesong?: string; + hockeyteam?: string; + favoritecolor?: string; + favoriteshow?: string; + favoriteopera?: string; favoriteactor?: string; + favoritetea?: string; favoriteactress?: string; + favoriteoccupation?: string; + favoriteseason?: string; favoriteartist?: string; favoriteauthor?: string; favoriteband?: string; - favoritebook?: string; - favoritecolor?: string; - favoritefood?: string; - favoritemovie?: string; - favoriteopera?: string; - favoriteseason?: string; - favoriteshow?: string; - favoritesong?: string; - favoritesport?: string; + favoritephilosopher?: string; favoritesubject?: string; - footballteam?: string; forfun?: string; - friend?: string; - friends?: string; - gender?: string; - genus?: string; - hockeyteam?: string; - kindmusic?: string; - language?: string; - location?: string; + build?: string; + etype?: string; + sign?: string; + looklike?: string; + wear?: string; + os?: string; + question?: string; + dailyclients?: string; + nclients?: string; + totalclients?: string; + birthdate?: string; ndevelopers?: string; + memory?: number; + alignment?: string; + celebrity?: string; + favoritequestion?: string; + feelings?: string; + footballteam?: string; + friend?: string; + girlfriend?: string; + hair?: string; + hourlyqueries?: string; + maxclients?: string; nclients?: string; orientation?: string; - os?: string; - party?: string; - phylum?: string; - physicallocation?: string; president?: string; - religion?: string; - scchinesesign?: string; - sccity?: string; - sccompany?: string; - sccountry?: string; - scfavoritecolor?: string; - scfavoritefood?: string; - scgender?: string; - scmaster?: string; - scnationality?: string; - scsign?: string; - scspecies?: string; - sign?: string; - species?: string; - state?: string; - totalclients?: string; - version?: string; - wear?: string; - wechat?: string; + richness?: string; + ethics?: string; + birthyear?: string; } + export interface TranslateOptions { from?: string, to?: string, @@ -93,9 +106,10 @@ export interface TranslateOptions { priority?: string[], services?: {"google_v3": { "project-id": string, "token": string } } | { "microsoft_v3": { "key": string, "location": "global" } } | { "yandex_v1": { "key": string } } | {"yandex_v2": {"key": string}} } + export class Client { /** - * The function to fetch respone from the Affiliate+ API + * The function to fetch respone from the Lebyy API * @type {Function} * @ignore * @private @@ -105,89 +119,96 @@ export class Client { /** * @param {object} ops - The options * @param {string} ops.message - The message - * @param {string} ops.name - The name of the bot - * @param {string} ops.master - The master of the bot * @param {string | number | bigint} ops.user - The user id - * @param {string} ops.language - The language of the returned reponse - * @param {string} ops.age - The age of the bot. - * @param {string} ops.birthyear - The birth year of the bot. - * @param {string} ops.vocabulary - The vocabulary count of the bot. - * @param {string} ops.baseballteam - The baseball team of the bot. - * @param {string} ops.birthdate - The birth date of the bot. - * @param {string} ops.birthday - The birthday of the bot. - * @param {string} ops.birthplace - The birthplace of the bot. - * @param {string} ops.build - The build version of the bot. - * @param {string} ops.celebrities - The celebrities of the bot. - * @param {string} ops.chinesesign - The chinese sign of the bot. - * @param {string} ops.city - The city of the bot. - * @param {string} ops.class - The class of the bot. - * @param {string} ops.company - The company of the bot. - * @param {string} ops.country - The country of the bot. - * @param {string} ops.email - The email of the bot. - * @param {string} ops.ethics - The ethics of the bot. - * @param {string} ops.etype - The etype of the bot. - * @param {string} ops.family - The family of the bot. - * @param {string} ops.job - The job of the bot. - * @param {string} ops.favoriteactor - The favorite actor of the bot. - * @param {string} ops.favoriteactress - The favorite actress of the bot. - * @param {string} ops.favoriteartist - The favorite artist of the bot. - * @param {string} ops.favoriteauthor - The favorite author of the bot. - * @param {string} ops.favoriteband - The favorite band of the bot. - * @param {string} ops.favoritebook - The favorite book of the bot. - * @param {string} ops.favoritecolor - The favorite color of the bot. - * @param {string} ops.favoritefood - The favorite food of the bot. - * @param {string} ops.favoritemovie - The favorite movie of the bot. - * @param {string} ops.favoriteopera - The favorite opera of the bot. - * @param {string} ops.favoriteseason - The favorite season of the bot. - * @param {string} ops.favoriteshow - The favorite show of the bot. - * @param {string} ops.favoritesong - The favorite song of the bot. - * @param {string} ops.favoritesport - The favorite sport of the bot. - * @param {string} ops.favoritesubject - The favorite subject of the bot. - * @param {string} ops.footballteam - The football team of the bot. - * @param {string} ops.forfun - The forfun activity of the bot. - * @param {string} ops.friend - The friend of the bot. - * @param {string} ops.friends - The friends of the bot. - * @param {string} ops.gender - The gender of the bot. - * @param {string} ops.genus - The genus of the bot. - * @param {string} ops.hockeyteam - The hockeyteam of the bot. - * @param {string} ops.kindmusic - The kindmusic of the bot. - * @param {string} ops.language - The language of the bot. - * @param {string} ops.location - The location of the bot. - * @param {string} ops.ndevelopers - The ndevelopers of the bot. - * @param {string} ops.nclients - The nclients of the bot. - * @param {string} ops.orientation - The orientation of the bot. - * @param {string} ops.os - The os of the bot. - * @param {string} ops.party - The party of the bot. - * @param {string} ops.phylum - The phylum of the bot. - * @param {string} ops.physicallocation - The physicallocation of the bot. - * @param {string} ops.president - The president of the bot. - * @param {string} ops.religion - The religion of the bot. - * @param {string} ops.scchinesesign - The scchinesesign of the bot. - * @param {string} ops.sccity - The sccity of the bot. - * @param {string} ops.sccompany - The sccompany of the bot. - * @param {string} ops.sccountry - The sccountry of the bot. - * @param {string} ops.scfavoritecolor - The scfavoritecolor of the bot. - * @param {string} ops.scfavoritefood - The scfavoritefood of the bot. - * @param {string} ops.scgender - The scgender of the bot. - * @param {string} ops.scmaster - The scmaster of the bot. - * @param {string} ops.scnationality - The scnationality of the bot. - * @param {string} ops.scsign - The scsign of the bot. - * @param {string} ops.scspecies - The scspecies of the bot. - * @param {string} ops.sign - The sign of the bot. - * @param {string} ops.species - The species of the bot. - * @param {string} ops.state - The state of the bot. - * @param {string} ops.totalclients - The totalclients of the bot. - * @param {string} ops.version - The version of the bot. - * @param {string} ops.wear - The wear of the bot. - * @param {string} ops.wechat - The wechat of the bot. + * @param {string} ops.name - The name of the chatbot + * @param {string} ops.master - The master of the chatbot + * @param {string} ops.age - The age of the chatbot + * @param {string} ops.friends - The friends of the chatbot + * @param {string} ops.botmaster - The botmaster of the chatbot + * @param {string} ops.boyfriend - The boyfriend of the chatbot + * @param {string} ops.genus - The genus of the chatbot + * @param {string} ops.size - The size of the chatbot + * @param {string} ops.species - The species of the chatbot + * @param {string} ops.location - The location of the chatbot + * @param {string} ops.order - The order of the chatbot + * @param {string} ops.birthday - The birthday of the chatbot + * @param {string} ops.kingdom - The kingdom of the chatbot + * @param {string} ops.gender - The gender of the chatbot + * @param {string} ops.favoritefood - The favoritefood of the chatbot + * @param {string} ops.emotions - The emotions of the chatbot + * @param {string} ops.mother - The mother of the chatbot + * @param {string} ops.state - The state of the chatbot + * @param {string} ops.nationality - The nationality of the chatbot + * @param {string} ops.country - The country of the chatbot + * @param {string} ops.city - The city of the chatbot + * @param {string} ops.phylum - The phylum of the chatbot + * @param {string} ops.domain - The domain of the chatbot + * @param {string} ops.family - The family of the chatbot + * @param {string} ops.vocabulary - The vocabulary of the chatbot + * @param {string} ops.class - The class of the chatbot + * @param {string} ops.email - The email of the chatbot + * @param {string} ops.kindmusic - The kindmusic of the chatbot + * @param {string} ops.favoritemovie - The favoritemovie of the chatbot + * @param {string} ops.language - The language spoken by chatbot + * @param {string} ops.job - The job of the chatbot + * @param {string} ops.birthplace - The birthplace of the chatbot + * @param {string} ops.religion - The religion of the chatbot + * @param {string} ops.party - The party of the chatbot + * @param {string} ops.celebrities - The celebrities of the chatbot + * @param {string} ops.arch - The arch of the chatbot + * @param {string} ops.version - The version of the chatbot + * @param {string} ops.talkabout - The talkabout topic of the chatbot + * @param {string} ops.website - The website of the chatbot + * @param {string} ops.favoritebook - The favoritebook of the chatbot + * @param {string} ops.favoritesport - The favoritesport of the chatbot + * @param {string} ops.favoritesong - The favoritesong of the chatbot + * @param {string} ops.hockeyteam - The hockeyteam of the chatbot + * @param {string} ops.favoritecolor - The favoritecolor of the chatbot + * @param {string} ops.favoriteshow - The favoriteshow of the chatbot + * @param {string} ops.favoriteopera - The favoriteopera of the chatbot + * @param {string} ops.favoriteactor - The favoriteactor of the chatbot + * @param {string} ops.favoritetea - The favoritetea of the chatbot + * @param {string} ops.favoriteactress - The favoriteactress of the chatbot + * @param {string} ops.favoriteoccupation - The favoriteoccupation of the chatbot + * @param {string} ops.favoriteseason - The favoriteseason of the chatbot + * @param {string} ops.favoriteartist - The favoriteartist of the chatbot + * @param {string} ops.favoriteauthor - The favoriteauthor of the chatbot + * @param {string} ops.favoriteband - The favoriteband of the chatbot + * @param {string} ops.favoritephilosopher - The favoritephilosopher of the chatbot + * @param {string} ops.favoritesubject - The favoritesubject of the chatbot + * @param {string} ops.forfun - The forfun activity of the chatbot + * @param {string} ops.build - The build of the chatbot + * @param {string} ops.etype - The etype of the chatbot + * @param {string} ops.sign - The sign of the chatbot + * @param {string} ops.looklike - The looklike of the chatbot + * @param {string} ops.wear - The wear of the chatbot + * @param {string} ops.os - The os of the chatbot + * @param {string} ops.question - The question of the chatbot + * @param {string} ops.dailyclients - The dailyclients of the chatbot + * @param {string} ops.nclients - The nclients of the chatbot + * @param {string} ops.totalclients - The totalclients of the chatbot + * @param {string} ops.birthdate - The birthdate of the chatbot + * @param {string} ops.ndevelopers - The ndevelopers of the chatbot + * @param {number} ops.memory - The memory of the chatbot + * @param {string} ops.alignment - The alignment of the chatbot + * @param {string} ops.celebrity - The celebrity of the chatbot + * @param {string} ops.favoritequestion - The favoritequestion of the chatbot + * @param {string} ops.feelings - The feelings of the chatbot + * @param {string} ops.footballteam - The footballteam of the chatbot + * @param {string} ops.friend - The friend of the chatbot + * @param {string} ops.girlfriend - The girlfriend of the chatbot + * @param {string} ops.hair - The hair of the chatbot + * @param {string} ops.hourlyqueries - The hourlyqueries of the chatbot + * @param {string} ops.maxclients - The maxclients of the chatbot + * @param {string} ops.orientation - The orientation of the chatbot + * @param {string} ops.president - The president of the chatbot + * @param {string} ops.richness - The richness of the chatbot + * @param {string} ops.ethics - The ethics of the chatbot + * @param {string} ops.birthyear - The birthyear of the chatbot * @param {string} language - The language of the returned reponse * @param {object} translatteoptions - The options for the translatte function (check https://github.com/extensionsapp/translatte#options) * @returns {Promise} The message returned by the chatbot **/ - chat( - ops?: ChatOptions, - language?: string, - translatteoptions?: TranslateOptions - ): Promise; + chat(ops?: ChatOptions, language?: string, translatteoptions?: TranslateOptions): Promise; } export declare const version: any; From 2e740c73a6b830b89945abeaafe77a2a17590e97 Mon Sep 17 00:00:00 2001 From: Lebyy <45114019+Lebyy@users.noreply.github.com> Date: Thu, 13 Oct 2022 22:36:24 +0530 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20|=20Modifying=20the=20error?= =?UTF-8?q?=20checking=20statement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index b3c428d..7b922eb 100644 --- a/index.js +++ b/index.js @@ -8,12 +8,13 @@ const superagent = require("superagent"); */ class Client { constructor(token) { + if (!token) throw new Error("No token provided!"); + /** * The token of the API * @type {string} */ this.token = token; - if (!token) throw new Error("No token provided!"); /** * The function to fetch respone from the Lebyy API