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 fromopenai
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
Types
simplydjs.chatbot(
message: ExtendedMessage,
options: chatbotOptions
): Promise<void>
- message
ExtendedMessage
- options:
chatbotOptions
Options
chatbotOptions
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
strict | boolean | ❌ | false | Enables strict mode in chatbot |
channelId | string[] | ✅ | - | Channel Id to set your chatbot in your server |
toggle | boolean | ❌ | true | Enable or Disable the chatbot for your preference. |
name | string | ❌ | Simply-DJS | Name of the chatbot you are talking to. (Would not apply to Chat-GPT) |
developer | string | ❌ | Rahuletto#0243 | Name of the developer who maintains the chatbot. (Would not apply to Chat-GPT) |
gptToken | string | ❌ | none | Enable 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
})