const Discord = require('discord.js');
const embed = require('discord-embed-maker');
const {RichEmbed} = require('discord.js');
const bot = new Discord.Client({disableEveryone: true});
const token = "TOKEN";
bot.on("ready", async () => {
console.log(${bot.user.username} IS ONLINE!!)
bot.user.setActivity("@ Ngahu's House", {type: "STREAMING"});
})
const fs = require("fs");
bot.commands = new Discord.Collection();
bot.aliases = new Discord.Collection();
fs.readdir("./commands/", (err, files) => {
if(err) console.log(err)
1
let jsfile = files.filter(f => f.split(".").pop() === "js")
if(jsfile.length <= 0) {
return console.kig("[LOGS] Couldn't Find Commands!");
}
jsfile.forEach((f, i) => {
let pull = require(./commands/${f});
bot.commands.set(pull.config.name, pull);
pull.config.aliases.forEach(alias => {
bot.aliases.set(alias, pull.config.name)
});
});
});
bot.on("message", async message =>{
if(message.author.bot) return;
if(message.channel.type === "dm") return;
let messageArray = message.content.split(" ");
let command = messageArray [0];
let args = messageArray.slice(1);
let cmd = messageArray[0];
let user = message.mentions.users.first() message.author;
console.log(user.roles); // it is undefined
let commandfile = bot.commands.get(cmd.slice(prefix.length)) bot.command.get(bot.aliases.get(cmd.slice (prefix.length)))
if(commandfile) commandfile.run(bot,message,args)
if (message.content === 'userinfo') {
let embed = new Discord.RichEmbed()
embed.setAuthor(message.author.username)
embed.setDescription("Information about yourself")
embed.setColor("#FF00FF")
embed.addField("Full Username", ${message.author.username}#${message.author.discriminator})
embed.addField("ID", message.author.id)
embed.addField("Created At", message.author.createdAt)
embed.setThumbnail(url="https://i.imgur.com/YjUfJKZ.png%22%22);
embed.setFooter("Generated By The Boys Penthouse with data from Discord", "https://i.imgur.com/YjUfJKZ.png%22%22)
message.channel.send(embed);
return;
}
})
bot.login(token)