Skip to main content

chatbot

A chatbot system that is both technically advanced and intelligent, and is your buddy.

Now with Chat-GPT mode ! pass an gptToken option to enable Chat-GPT chatbot for your bot. Requires a ChatGPT token from openai

Implementation

simplydjs.chatbot(message, { 
channelId: ['01234567890123'] // channelId (required)

// options (optional)
})
INFO

This should be implemented in the messageCreate event and requires Message Intent!

client.on('messageCreate', (message) => {
simplydjs.chatbot(message) // chatbot function
})

Output

chatbot

Types

simplydjs.chatbot(
message: ExtendedMessage,
options: chatbotOptions
): Promise<void>

Options

chatbotOptions

ParameterTypeRequiredDefaultDescription
strictbooleanfalseEnables strict mode in chatbot
channelIdstring[]-Channel Id to set your chatbot in your server
togglebooleantrueEnable or Disable the chatbot for your preference.
namestringSimply-DJSName of the chatbot you are talking to. (Would not apply to Chat-GPT)
developerstringRahuletto#0243Name of the developer who maintains the chatbot. (Would not apply to Chat-GPT)
gptTokenstringnoneEnable Chat-GPT mode and use gpt model instead of traditional nlp small data sets.
export type chatbotOptions = {
strict?: boolean;
channelId?: string | string[];
toggle?: boolean;
name?: string;
developer?: string;
gptToken?: string; // To access ChatGPT
};

Example

  • Default settings

chatbot.js
const simplydjs = require('simply-djs')

simplydjs.chatbot(message, {
channelId: ["01234567890123"] // required
})
  • Customized with options

chatbot.js
const simplydjs = require('simply-djs')

simplydjs.chatbot(message, {
channelId: ["01234567890123"], // required
strict: true,
toggle: true,
name: "Simply-DJS",
developer: "Rahuletto#0243"
})
  • For Chat-GPT

chatbot-gpt.js
const simplydjs = require('simply-djs')

simplydjs.chatbot(message, {
channelId: ["01234567890123"], // required
strict: true,
toggle: true,
gptToken: "XXXX-XXXX-XXXX-XXXX" // your openai api key
})