├── .gitignore ├── .npmignore ├── clever-chat ├── .prettierignore └── .prettierrc.json ├── .gitattributes ├── index.js ├── .vscode └── settings.json ├── .github └── dependabot.yml ├── typings └── index.d.ts ├── package.json ├── src ├── defaultOptions.json └── chatbot.js └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /clever-chat/.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=TypeScript 2 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./src/chatbot.js") 2 | //small index.js lol -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.defaultFormatter": "esbenp.prettier-vscode", 3 | "editor.formatOnSave": true 4 | } -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /typings/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module "clever" { 2 | export class Chatbot { 3 | constructor(ops: object); 4 | public chat(message: string): Promise; 5 | } 6 | } 7 | //more ts commingTM 8 | -------------------------------------------------------------------------------- /clever-chat/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "trailingComma": "none", 4 | "quoteProps": "as-needed", 5 | "bracketSpacing": true, 6 | "arrowParens": "avoid", 7 | "printWidth": 80, 8 | "tabWidth": 4, 9 | "endOfLine": "auto" 10 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | {"name":"clever-chat","version":"8.0.0","description":"Easy to use NPM package for chatbots made by Sunny Development","main":"index.js","types":"typings/index.d.ts","keywords":["quick.chat","quickchat","clever-chat","chat.js","sunnydevelopment"],"author":"royalnotfound","contributors":["positive2022","wideirenakan1","code123456789101112","ace-1234"],"license":"MIT","dependencies":{"@vitalets/google-translate-api":"^7.0.0","node-fetch":"^2.6.1"},"repository":{"type":"git","url":"https://github.com/HisRoyalBaguettes/clever-chat-v7"},"devDependencies":{"prettier":"^2.3.2","typescript":"^4.1.3"}} -------------------------------------------------------------------------------- /src/defaultOptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chatbot", 3 | "gender": "female", 4 | "developer_name": "Acobot Team", 5 | "user": "user", 6 | "age": "732", 7 | "birthday": "pog", 8 | "birthplace": "France", 9 | "birthyear": "2005", 10 | "religion": "Panda", 11 | "actor": "Brad Pitt", 12 | "actress": "Julia Roberts", 13 | "artist": "Leonardo", 14 | "author": "Jeff Kinney", 15 | "band": "Imagine", 16 | "book": "Diary", 17 | "celebrity": "Taylor Swift", 18 | "chinesesign": "Dragon", 19 | "family": "chat bot", 20 | "etype": "chat bot", 21 | "ethics": "the golden rule", 22 | "color": "green", 23 | "food": "eletricity", 24 | "movie": "Matrix", 25 | "opera": "Carmen", 26 | "season": "Spring", 27 | "show": "Discovery", 28 | "song": "Believer", 29 | "sport": "Baseball", 30 | "subject": "making friends", 31 | "football": "Dallas Cowboys", 32 | "baseball": "New York Yankees", 33 | "city": "San Francisco", 34 | "state": "California", 35 | "class": "Artificial Intelligence", 36 | "country": "united states", 37 | "company": "Acobot", 38 | "email": "Hisroyal.baguette@gmail.com", 39 | "wechat": "Brainshop", 40 | "wear": "my shinning virtual wardrobe", 41 | "vocab": "20000", 42 | "version": "Beta", 43 | "totalcli": "hundreds of thousands", 44 | "species": "artificial intelligence chatbot", 45 | "sign": "Pisces", 46 | "scspecies": "智能机器人", 47 | "scsign": "双鱼座", 48 | "scnationality": "中国", 49 | "scmaster": "Acobot 团队", 50 | "scgender": "女", 51 | "scfavouritefood": "电", 52 | "scfavouritecolor": "绿色", 53 | "sccountry": "中国", 54 | "sccompany": "艾珂(北京)智能系统有限公司", 55 | "sccity": "北京", 56 | "scchinesesign": "龙", 57 | "language2": "English", 58 | "hockey": "New York Rangers", 59 | "job": "chat bot", 60 | "music": "techno", 61 | "celebrities": "C3PO", 62 | "orientation": "Straight", 63 | "phylum": "Software", 64 | "president": "Joe Biden" 65 | 66 | } -------------------------------------------------------------------------------- /src/chatbot.js: -------------------------------------------------------------------------------- 1 | // npx prettier --write src/chatbot.js should i do this?? ok then 2 | // do this whenever u want prettier to format the code 3 | 4 | const defaultOptions = require("./defaultOptions.json"); 5 | 6 | const fetch = require("node-fetch"); 7 | const translate = require("@vitalets/google-translate-api"); 8 | 9 | class Chatbot { 10 | constructor( 11 | ops = defaultOptions 12 | ) { 13 | this.ops = ops; 14 | } 15 | 16 | async chat(message) { 17 | if (!message) { 18 | throw new Error( 19 | "[Chatbot API] You need to provide a message to reply to!" 20 | ); 21 | } 22 | 23 | const { ops } = this; 24 | 25 | let language = ops.language 26 | 27 | const url = Object.keys(ops) 28 | .map(op => `${op}=${encodeURIComponent(ops[op])}`) 29 | .join("&"); 30 | 31 | let res = await fetch( 32 | `https://yourmommmaosamaobama.hisroyal123.repl.co/?message=${encodeURIComponent(message)}&${url}` 33 | ).catch(e => { 34 | throw new Error(`Ran into an Error. ${e}`); 35 | }); 36 | 37 | const response = await res.json(); 38 | const translation = await translate(response.message, {to: ops.language}).catch(e => { 39 | throw new Error(`Ran into an Error. ${e}`); 40 | }); 41 | 42 | const replacers = { 43 | "Atom": ops.name, 44 | "female": ops.gender, 45 | "Acobot Team": ops.developer_name, 46 | "user": ops.user, 47 | "732": ops.age, 48 | "pog": ops.birthday, 49 | "France": ops.birthplace, 50 | "2005": ops.birthyear, 51 | "Panda": ops.religion, 52 | "Brad Pitt": ops.actor, 53 | "Julia Roberts": ops.actress, 54 | "Leonardo": ops.artist, 55 | "Jeff Kinney": ops.author, 56 | "Imagine": ops.band, 57 | "Diary": ops.book, 58 | "Taylor Swift": ops.celebrity, 59 | "C3P0": ops.celebrities, 60 | "Dragon": ops.chinesesign, 61 | "chat bot": ops.family, 62 | "the golden rule": ops.ethics, 63 | "green": ops.color, 64 | "eletricity": ops.food, 65 | "Matrix": ops.movie, 66 | "Carmen": ops.opera, 67 | "Spring": ops.season, 68 | "Discovery": ops.show, 69 | "Believer": ops.song, 70 | "Baseball": ops.sport, 71 | "making friends": ops.subject, 72 | "Dallas Cowboys": ops.football, 73 | "New York Yankees": ops.baseball, 74 | "San Francisco": ops.city, 75 | "California": ops.state, 76 | "Artificial Intelligence": ops.class, 77 | "united states": ops.country, 78 | "Acobot": ops.company, 79 | "Hisroyal.baguette@gmail.com": ops.email, 80 | "Brainshop": ops.wechat, 81 | "my shinning virtual wardrobe": ops.wear, 82 | "20000": ops.vocab, 83 | "Beta": ops.version, 84 | "hundreds of thousands": ops.totalcli, 85 | "artificial intelligence chatbot": ops.species, 86 | "Pisces": ops.sign, 87 | "智能机器人": ops.scspecies, 88 | "双鱼座": ops.scsign, 89 | "中国": ops.scnationality, 90 | "Acobot 团队": ops.scmaster, 91 | "女": ops.scgender, 92 | "电": ops.scfavouritefood, 93 | "绿色": ops.scfavouritecolor, 94 | "中国": ops.sccountry, 95 | "艾珂(北京)智能系统有限公司": ops.sccompany, 96 | "北京": ops.sccity, 97 | "龙": ops.scchinesesign, 98 | "English": ops.language2, 99 | "New York Rangers": ops.hockey, 100 | "chat bot": ops.job, 101 | "techno": ops.music, 102 | "Straight": ops.orientation, 103 | "Software": ops.phylum, 104 | "Joe Biden": ops.president 105 | 106 | }; 107 | 108 | return translation.text.replace( 109 | /.+/g, 110 | match => replacers[match] || match 111 | ); 112 | 113 | if (!response) { 114 | throw new Error( 115 | "[Chatbot API] API is unavailable. Please try again later. Contact Royalty#2021 on Discord if you think this is a mistake." 116 | ); 117 | } 118 | 119 | return response.message; 120 | } 121 | } 122 | 123 | module.exports = Chatbot; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Clever-Chat 2 | 3 | 4 | Important: PROJECT ABANDONED. AS OF NOVEMBER 2022, I HAVE ABANDONED THIS PROJECT NOT ONLY DUE TO INACTIVITY, BECAUSE THERE ISN'T ANY WORTHWHILE FEATURES TO BE ADDED. I CANNOT GUARANTEE IF IT WILL WORK FROM THEREAFTER. 5 | 6 | ![F4pEry6](https://nodei.co/npm/clever-chat.png?downloads=true&stars=true) 7 | 8 | 9 | Downloads 10 | 11 | 12 | 13 | Npm version 14 | 15 | 16 | - Clever-Chat is a wrapper for a chatbot API that you can use to make a chatbot in node.js created by [Sunny Development](https://sunnydevelopment.ml/) 17 | 18 | ## What's New! 19 | - Added __gender__, __developer name__ and __user__ as an option! 20 | 21 | - Added __TypeScipt__ Support! 22 | 23 | ## Installation 24 | 25 | ```bash 26 | npm i clever-chat 27 | ``` 28 | ## Example 29 | 30 | - Note: This is an just example code, you can edit it to make it more advanced. 31 | 32 | ```javascript 33 | // import the package 34 | const Chat = require("clever-chat"); 35 | const chat = new Chat({ name: "Put Your Chatbot Name Here", gender: "Male", developer_name: "Put Your Name Here", user: "Put an ID here", language: "Put a language here" }); //all of these are REQUIRED 36 | 37 | chat.chat('Hey! How are you!').then(reply => { 38 | console.log(reply) 39 | }) 40 | // wait for the console to log the reply 41 | ``` 42 | ## Information 43 | - If any bugs found, please report it in the __Discord Server__ or __Github__. 44 | 45 | - A list for the options - 46 | | Parameter | Type | Description 47 | | --- | --- | --- | 48 | | `name` | `string` | Sets chatbot's name 49 | | `gender` | `string` | Sets chatbot's gender| 50 | | `developer_name` | `string` | Sets chatbot's developer name 51 | | `user` | `string` | Put an ID here| 52 | | `age` | `string` | Sets chatbot's age 53 | | `birthday` | `string` | Sets chatbot's birthday| 54 | | `birthplace` | `string` | Sets chatbot's birthplace 55 | | `birthyear` | `string` | Sets chatbot's birthyear| 56 | | `religion` | `string` | Sets chatbot's religion 57 | | `actor` | `string` | Sets chatbot's favourite actor| 58 | | `actress` | `string` | Sets chatbot's favourite actress 59 | | `artist` | `string` | Sets chatbot's favourite artist| 60 | | `author` | `string` | Sets chatbot's favourite author 61 | | `band` | `string` | Sets chatbot's favourite band| 62 | | `book` | `string` | Sets chatbot's favourite book 63 | | `color` | `string` | Sets chatbot's favourite colour 64 | | `food` | `string` | Sets chatbot's favourite food| 65 | | `movie` | `string` | Sets chatbot's favourite movie 66 | | `opera` | `string` | Sets chatbot's favourite opera| 67 | | `season` | `string` | Sets chatbot's favourite season 68 | | `show` | `string` | Sets chatbot's favourite show| 69 | | `song` | `string` | Sets chatbot's favourite song 70 | | `sport` | `string` | Sets chatbot's favourite sport| 71 | | `subject` | `string` | Sets chatbot's favourite subject 72 | | `football` | `string` | Sets chatbot's favourite football team| 73 | | `celebrity` | `string` | Sets chatbot's favourite celebrity| 74 | | `chinesesign` | `string` | Sets chatbot's chinese sign 75 | | `family` | `string` | Sets chatbot's family| 76 | | `ethics` | `string` | Sets chatbot's name 77 | | `etype` | `string` | Sets chatbot's etype| 78 | | `baseball` | `string` | Sets chatbot's faovourite baseball team 79 | | `city` | `string` | Sets chatbot's city| 80 | | `state`| `string` | Sets chatbot's state 81 | |`class`| `string` | Sets chatbot's class| 82 | |`country`| `string` | Sets chatbot's country| 83 | |`company`| `string` | Sets chatbot's company| 84 | |`email`| `string` | Sets the chatbot's support email| 85 | |`wechat`| `string` | Sets chatbot's wechat| 86 | |`wear`| `string` | Sets chatbot's favourite cloth/wear| 87 | |`vocab`| `string` | Sets chatbot's number of vocabulary| 88 | |`version`| `string` | Sets your chatbot's version/your bot's version| 89 | |`totalcli`| `string` | Sets chatbot's total clients| 90 | |`species`| `string` | Sets chatbot's species| 91 | |`sign`| `string` | Sets chatbot's sign| 92 | |`scspecies`| `string` | Sets chatbot's species (chinese)| 93 | |`scsign`| `string` | Sets chatbot's sign (chinese)| 94 | |`scnationality`| `string` | Sets chatbot's nationality (chinese)| 95 | |`scmaster`| `string` | Sets chatbot's master/owner/developer_name (chinese)| 96 | |`scgender`| `string` | Sets chatbot's gender (chinese)| 97 | |`scfavouritecolor`|`string` | Sets chatbot's favourite color (chinese)| 98 | |`scfavouritefood`| `string` | Sets chatbot's favourite food (chinese)| 99 | |`sccountry`| `string` | Sets chatbot's country (chinese)| 100 | |`sccompany`| `string` | Sets chatbot's company (chinese)| 101 | |`sccity`| `string` | Sets chatbot's city (chinese)| 102 | |`scchinesesign`| `string` | Sets chatbot's chinese sign (chinese)| 103 | |`language2`| `string` | Sets chatbot's language while chatting| 104 | |`hockey`| `string` | Sets chatbot's favourite hockey team| 105 | |`job`| `string` | Sets chatbot's job| 106 | |`music`| `string` | Sets chatbot's favourite music| 107 | |`celebrities`| `string` | Sets chatbot's favourite celebrities/characters| 108 | |`orientation`| `string` | Sets chatbot's orientation| 109 | |`phylum`| `string` | Sets chatbot's phylum| 110 | |`president`| `string` | Sets chatbot's president| 111 | 112 | 113 | 114 | 115 | Something missing? Found a bug/problem? Want to suggest something?? Make an issue/PR in the github repository! 116 | 117 | ## Credits 118 | - Made by Sunny Development (Royal, Acê, and thecoolguy17) 119 | - Brainshop AI 120 | - Possible for translation because of google-translate-api. (Note = Latency/Ping *might* be high.) 121 | 122 | ## Language List - 123 | **Name Of Language**|**Code for Languages** 124 | :-----:|:-----: 125 | Automatic|auto 126 | Afrikaans|af 127 | Irish|ga 128 | Albanian|sq 129 | Italian|it 130 | Arabic|ar 131 | Japanese|ja 132 | Azerbaijani|az 133 | Kannada|kn 134 | Basque|eu 135 | Korean|ko 136 | Bengali|bn 137 | Latin|la 138 | Belarusian|be 139 | Latvian|lv 140 | Bulgarian|bg 141 | Lithuanian|lt 142 | Catalan|ca 143 | Macedonian|mk 144 | Chinese Simplified|zh-CN 145 | Malay|ms 146 | Chinese Traditional|zh-TW 147 | Maltese|mt 148 | Croatian|hr 149 | Norwegian|no 150 | Czech|cs 151 | Persian|fa 152 | Danish|da 153 | Polish|pl 154 | Dutch|nl 155 | Portuguese|pt 156 | English|en 157 | Romanian|ro 158 | Esperanto|eo 159 | Russian|ru 160 | Estonian|et 161 | Serbian|sr 162 | Filipino|tl 163 | Slovak|sk 164 | Finnish|fi 165 | Slovenian|sl 166 | French|fr 167 | Spanish|es 168 | Galician|gl 169 | Swahili|sw 170 | Georgian|ka 171 | Swedish|sv 172 | German|de 173 | Tamil|ta 174 | Greek|el 175 | Telugu|te 176 | Gujarati|gu 177 | Thai|th 178 | Haitian Creole|ht 179 | Turkish|tr 180 | Hebrew|iw 181 | Ukrainian|uk 182 | Hindi|hi 183 | Urdu|ur 184 | Hungarian|hu 185 | Vietnamese|vi 186 | Icelandic|is 187 | Welsh|cy 188 | Indonesian|id 189 | Yiddish|yi 190 | 191 | 192 | 193 | ## Support Server 194 | ~ [*Programmer's Haven*](https://discord.gg/AEw8g8yVNV) 195 | 196 | ## Github 197 | ~ [**Github**](https://github.com/hisRoyalty/clever-chat-v7) 198 | 199 | 200 | --------------------------------------------------------------------------------