Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

discord chatbot

 -> npm install discord.js smartestchatbot <-
// Use this command in terminal/console which is inside arrows

//Code Below make index and put this code there using modules are Very easy.

const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
const smartestchatbot = require('smartestchatbot');

const chater = new smartestchatbot.Client();
client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('messageCreate', async msg => {
  
  chater.chat({message: msg, name:"SmartestChatbot", owner:"YourName", user: CoolUniqueUserId-In-NumberType}, "en").then(reply => {
console.log(reply);
    msg.reply(reply)
// The module will reply based on the message!
});
 
});

client.login('token');
 
PREVIOUS NEXT
Tagged: #discord #chatbot
ADD COMMENT
Topic
Name
6+5 =