Answer the question
In order to leave comments, you need to log in
Can't see get in bot.js, what should I do?
Here is the bot.js code:
const Discord = require('discord.js');
const bot = new Discord.Client();
bot.commands = new Discord.Collection();
const fs = require("fs");
let config = require('./botconfig.json');
let token = config.token
let prefix = config.prefix
fs.readdir('./cmds/',(err,files)=>{
if(err) console.log(err);
let jsfiles = files.filter(f => f.split(".").pop() === "js");
if(jsfiles.length <=0) console.log("Нет команд для загрузки!");
console.log(`Загружено ${jsfiles.length} команд`);
jsfiles.forEach((f,i) =>{
let props = require(`./cmds/${f}`);
console.log(`${i+1}.${f} Загружен!`);
bot.commands.set(props.help.name,props);
})
bot.on('ready', () => {
console.log(`Включився ${bot.user.username}`);
bot.generateInvite(["ADMINISTRATOR"]).then(link =>{
console.log(link);
})
});
bot.on('message', async message => {
if(message.author.bot) return;
if(message.channel.type == "dm") return;
let user = message.author.username;
let userid = message.author.id;
let messageArray = message.content.split(" ");
let command = messageArray[0].toLowerCase();
let args = messageArray.slice(1);
if(!message.content.startsWith(prefix)) return;
let cmd = bot.command.get(command.slice(prefix.length));
if(cmd) cmd.run(bot,message,args);
});
bot.login(token)});
const Discord = module.require("discord.js");
const fs = require("fs");
module.exports.run = async (bot,message,args) => {
message.channel.send('pong!');
};
module.exports.help = {
name: "ping"
};
Answer the question
In order to leave comments, you need to log in
https://discordjs.guide/additional-info/changes-in...
The ClientUserGuildSettings class has been removed entirely, along with all other user account-only properties and methods.
The ClientUserGuildSettings class has been completely removed, along with all other user account-only properties and methods.
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`${client.user.tag} запустился!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('Pong!');
}
});
client.login('token');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question