22 lines
459 B
JavaScript
22 lines
459 B
JavaScript
import cleverbot from "./lib/cleverbot";
|
|
|
|
export default bot => {
|
|
bot._trigger.set("chatbot", new bot.trigger({
|
|
call: /.*uwe.*/i,
|
|
clients: ["tg"],
|
|
active: true,
|
|
f: e => {
|
|
const chat = e.message
|
|
.replace(/uwe/gi, "")
|
|
.split("?")
|
|
.join("");
|
|
cleverbot.ask(chat)
|
|
.then(res => {
|
|
e.reply(res.response);
|
|
})
|
|
.catch(err => {
|
|
console.log(err);
|
|
});
|
|
}
|
|
}));
|
|
}; |