smart-chatbot
Advanced tools
Comparing version 1.3.0 to 1.4.0
10
main.js
@@ -23,2 +23,3 @@ const axios = require("axios"); | ||
if(!mainjson.ownername || typeof mainjson.secretkey !== "string") return console.error("[" + packagename + "] Owner Name Problem"); | ||
if(mainjson.gender && (mainjson.gender != "male" && mainjson.gender != "female")) return console.error("[" + packagename + "] Gender Problem"); | ||
@@ -29,3 +30,10 @@ if(!json.message || typeof json.message !== "string") reject("No message was provided"); | ||
axios.get(`${baseURL}/chatbot?message=${encodeURIComponent(json.message)}&user=${encodeURIComponent(json.user)}&language=${encodeURIComponent(json.language)}&botname=${encodeURIComponent(mainjson.botname)}&ownername=${encodeURIComponent(mainjson.ownername)}`, { | ||
var urlcreate = `${baseURL}/chatbot?message=${encodeURIComponent(json.message)}&user=${encodeURIComponent(json.user)}&language=${encodeURIComponent(json.language)}&botname=${encodeURIComponent(mainjson.botname)}&ownername=${encodeURIComponent(mainjson.ownername)}`; | ||
if(mainjson.gender) urlcreate += `&gender=${encodeURIComponent(mainjson.gender)}`; | ||
if(mainjson.birth) urlcreate += `&birth=${encodeURIComponent(mainjson.birth)}`; | ||
if(mainjson.location) urlcreate += `&location=${encodeURIComponent(mainjson.location)}`; | ||
if(mainjson.email) urlcreate += `&email=${encodeURIComponent(mainjson.email)}`; | ||
axios.get(urlcreate, { | ||
headers: { | ||
@@ -32,0 +40,0 @@ 'Authorization': `${mainjson.secretkey}`, |
{ | ||
"name": "smart-chatbot", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Intelligent Chat Bot Api", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -10,3 +10,11 @@ <p align="center"><a href="https://nodei.co/npm/smart-chatbot"><img src="https://nodei.co/npm/smart-chatbot.png"></a></p> | ||
const chatbot = require("smart-chatbot"); | ||
const chatclient = new chatbot.Client({ secretkey: "SECRET KEY", botname: "BOT NAME", ownername: "OWNER NAME" }); | ||
const chatclient = new chatbot.Client({ | ||
secretkey: "SECRET KEY", | ||
botname: "BOT NAME", | ||
ownername: "OWNER NAME", | ||
gender: "female", // (female/male) | ||
birth: "https://csycraft.com", | ||
location: "https://csybot.csycraft.com", | ||
email: "brain@csycraft.com" | ||
}); | ||
@@ -26,3 +34,11 @@ chatclient.chat({ | ||
const chatbot = require("smart-chatbot") | ||
const chatclient = new chatbot.Client({ secretkey: "SECRET KEY", botname: "BOT NAME", ownername: "OWNER NAME" }); | ||
const chatclient = new chatbot.Client({ | ||
secretkey: "SECRET KEY", | ||
botname: "BOT NAME", | ||
ownername: "OWNER NAME", | ||
gender: "female", // (female/male) | ||
birth: "https://csycraft.com", | ||
location: "https://csybot.csycraft.com", | ||
email: "brain@csycraft.com" | ||
}); | ||
let question = message.content.split(" ").slice(1).join(" "); | ||
@@ -29,0 +45,0 @@ if(!question || String(question) == String([])) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18262
58
75