1.0.6 • Published 4 years ago

@typicalninja21/chatbot.js v1.0.6

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

@typicalninja/chatbot.js

GitHub license

npm (scoped)

npm bundle size (minified)

npm package chatbot.js

Install

$ npm i @typicalninja21/chatbot.js

Usage

const chat = require('@typicalninja21/chatbot.js')



chat.reply('hello').then(message => {
    console.log(message.response) // hello how are you
})

usage in a discord bot

const Discord = require('discord.js');
const chat = require('@typicalninja21/chatbot.js')

const client = new Discord.Client()

client.once('ready', async () => {
console.log('ready')
});

client.on('message', async message => {

  if (!message.channel.guild) return;
  
  if(message.author.bot) return;
  
  if (message.channel.name == `channel-name`) {

chat.reply('hello').then(message => {
    message.channel.send(message.response) // hello how are you
})
});
client.login('super secret bot token');
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago