📅  最后修改于: 2022-03-11 15:03:48.504000             🧑  作者: Mango
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require("./config.json")
client.on("ready", () => {
console.log(`Bot Foi Iniciado, com ${client.users.cache.size} usuários, em ${client.channels.cache.size} canais, em ${client.guilds.cache.size} servidores.`);
client.user.setActivity(`Dinheiro Na Putaria`);
client.user.setUsername('Hidrz')
});
const prefix = "!";
client.on("message", async message => {
if (message.author.bot) return;
if (message.channel.type == 'dm') return;
if (!message.guild) return;
if (!message.content.toLowerCase().startsWith(config.prefix.toLowerCase())) return;
if (message.content.startsWith(`<@!${client.user.id}>`) || message.content.startsWith(`<@${client.user.id}>`)) return;
const args = message.content
.trim().slice(config.prefix.length)
.split(/ +/g);
const command = args.shift().toLowerCase();
try {
const commandFile = require(`./commands/${command}.js`)
commandFile.run(client, message, args);
} catch (err) {
console.error('Erro:' + err);
}
});
client.login(config.token)