Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const login=require("facebook-chat-api");
- const axios = require("axios");
- var lydo="(Khoa is going defecates)";
- var emote =":3 :) :D :( :'( :P O:) 3:) o.O ;) :O -_- >:O :* <3 ^_^ 8-) >:( ♒ :/ ♊ ☺ (y) :poop: ☀ ☁ ☔ ⚡ ✨ ⭐ ✳ ⛄ ☕ ♨ ⛵ ⛽ ✈ ⛲ ⛺ ⛪ ☎ ✉ ✂ 🚽 🛀 👙 👙 👕 👘 👗 👢 👠 👡 💼 👜 👔 🎩 👒 👑 💍 🚭 ⚽ ⚾ ⚾ ⛳ 🏈 🏀 🎾 🎱 🎯 🎿 🎌 🏁 🏆";
- var icon_arr = emote.split(' ');
- var icon;
- var mem=[];
- login({email:"dauvanhuyhoang@yahoo.com.vn", password:"dauvanhuyhoang44"}, function(err, api){
- if (err) return console.log(err);
- api.listen(function(err, mssg){
- if (mssg.body=='on')
- mem[mssg.threadID]='co';
- if (mssg.body=='off')
- mem[mssg.threadID]='khong';
- if (mssg.body=='yes' && !mem[mssg.threadID]){
- mem[mssg.threadID]='co';
- }
- if (mssg.body=='no' && !mem[mssg.threadID]){
- mem[mssg.threadID]='khong';
- }
- if (mem[mssg.threadID]=='khong'){
- return 0;
- }
- icon = " "+icon_arr[Math.round(Math.random()*icon_arr.length)];
- console.log(icon);
- axios.get('http://api.minhhieu.asia/en.php',{params:{text:mssg.body}}).then(res=>{
- if (res.data == ' Bạn Chưa Nhập Câu Hỏi. Write a message and hit to chat! ' || res.data.indexOf('Talk with random person')!=-1)
- api.sendMessage("I don't understand :3? "+icon , mssg.threadID);
- else{
- if (!mem[mssg.threadID])
- api.sendMessage('Do you want to chat with chatbot?? (yes/no) [['+lydo+']]', mssg.threadID);
- else{
- if (mem[mssg.threadID]=='yes')
- api.sendMessage(lres.data + icon, mssg.threadID);
- }
- }
- console.log(mssg.body+' - '+res.data);
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement