pop-cat-chat
v1.3.0
Published
A lightweight chatbot using popcat api
Downloads
13
Readme
Installation
npm i pop-cat-chat
Constructor Options
const Chat = require("pop-cat-chat");
const chat = new Chat({ name: "YourChatBotName" })
Test Example
const Chat = require("pop-cat-chat");
const chat = new Chat({ name: "Test" })
async function test(message) {
let reply = await chat.chat(message)
console.log(reply)
}
test('what is your name')
Response
"You know I'm Test, right?"
Discord Example
const Discord = require("discord.js");
const client = new Discord.Client({intents: ["GUILDS", "GUILD_MESSAGES"]});
const Chat = require("pop-cat-chat");
const chat = new Chat({ name: "Your Bot Name" });
client.on("ready", () => {
console.log(`Logged in to ${client.user.tag}`);
});
client.on("messageCreate", async message => {
if(message.channel.name === "chat" && !message.author.bot) {
let reply = await chat.chat(message.content)
message.channel.send(reply)
}
});
client.login("Your Token Here");