Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Commando = require("discord.js-commando")
- const Discord = require("discord.js")
- const bot = new Commando.Client();
- const token = "NDg0MDY3MDU0NTcyMjczNjY0.Dmj4WA.IMLxWsPw6e5In6bu0q22bVQj0i0";
- const botconfig = require("./botconfig.json");
- const economy = require("discord-eco")
- const dba = require('discord-dba');
- const fs = require("fs");
- let prefix2 = '^';
- bot.commands = new Discord.Collection();
- bot.on('message', message => {
- if(message.content.startsWith("Unknown command.")) {
- message.delete(100);
- message.channel.send(message.content.slice(5, message.content.length));
- }
- });
- fs.readdir("./cmds/", (err, files) => {
- if(err) console.log(err);
- let jsfile = files.filter(f => f.split(".").pop() === "js")
- if(jsfile.length <= 0){
- console.log("Couldn't find commands.");
- return;
- }
- jsfile.forEach((f, i) =>{
- let props = require(`./cmds/${f}`);
- console.log(`${f} loaded!`);
- bot.commands.set(props.help.name, props)
- });
- });
- const mysql = require('mysql');
- const express = require('express')
- const Client = require('fortnite')
- const fortnite = new Client("aaed04ee-dec9-4b32-bfce-0fca0cbf7f34");
- var app = express();
- var connection = mysql.createConnection({
- host: 'localhost',
- user: 'root',
- password: '',
- database: 'sampleDB'
- });
- let coins = require("./commands/economy/coins.json");
- bot.registry.registerGroup('simple', 'Simple');
- bot.registry.registerGroup('music', 'music');
- bot.registry.registerGroup('economy', 'economy');
- bot.registry.registerCommandsIn(__dirname + '/commands');
- bot.registry.registerDefaults();
- bot.on("message", function(message){
- let messageArray = message.content.split(" ");
- msg = message.content.toLowerCase();
- let cmd = messageArray[0];
- let args = messageArray.slice(1);
- let commandfile = bot.commands.get(cmd.slice(prefix2.length));
- if(commandfile) commandfile.run(bot,message,args);
- if(message.content == "hello"){
- message.channel.sendMessage("Hello!" + message.author + ",how are you?")
- }
- if (message.content.startsWith("krabby patty")) {
- message.channel.send("PREPARING THE KRABBY PATTY!", {files: ["./images/patty.png"]});
- return;
- }
- if (message.content === "ping"){
- message.channel.send("Pong!");
- return;
- }
- if (message.content === "what do i look like") {
- message.channel.send(message.author.avatarURL);
- message.channel.send("Also UGLY As Fuck");
- return;
- }
- //Test Economy
- if (message.content === "payday") {
- economy.updateBalance(message.author.id, 500).then((i) => {
- message.channel.send(`**You got $500**\n**New Balance:** ${i.money}`);
- })
- }
- if (message.content === "balance") {
- economy.fetchBalance(message.author.id).then((i) => { // economy.fetchBalance grabs the userID, finds it, and puts it into 'i'.
- message.channel.send(`**Balance:** ${i.money}`);
- })
- }
- if (message.content === "payfine") {
- economy.updateBalance(message.author.id, -500).then((i) => { // Since the 'value' is -500, it will 'add' -500, making the balance $500 lower.
- message.channel.send(`**You paid your fine of $500!**\n**New Balance:** ${i.money}`);
- })
- }
- if (message.content === "meme")/*if you want to start with the prefix just do if (message.startsWith (prefix + "meme"))*/ {
- number = 302;
- imageNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
- message.channel.send ({files: ["./images/memes/" + imageNumber + ".png"]})
- }
- if (message.content === "SALbotinfo"){
- let bicon = bot.user.displayAvatarURL;
- let botembed = new Discord.RichEmbed()
- .setDescription("Bot Information")
- .setColor("#51ff77")
- .setThumbnail(bicon)
- .addField("Bot Name", bot.user.username)
- .addField("Created On", bot.user.createdAt);
- return message.channel.send(botembed);
- }
- if (message.content === "SALserverinfo"){
- let sicon = message.guild.iconURL;
- let serverembed = new Discord.RichEmbed()
- .setDescription("Server Information")
- .setColor("#51ffff")
- .setThumbnail(sicon)
- .addField("Server Name", message.guild.name)
- .addField("Created On", message.guild.createdAt)
- .addField("You Joined", message.member.joinedAt)
- .addField("Total Members", message.guild.memberCount);
- return message.channel.send(serverembed);
- }
- if(message.content.startsWith(`SALreport`)){
- let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
- if(!rUser) return message.channel.send("Couldn't find user.");
- let reason = args.join(" ").slice(22);
- let reportEmbed = new Discord.RichEmbed()
- .setDescription("Reports")
- .setColor("#15f")
- .addField("Reported User", `${rUser} with ID: ${rUser.id}`)
- .addField("Reported By", `${message.author} with ID: ${message.author.id}`)
- .addField("Channel", message.channel)
- .addField("Time", message.createdAt)
- .addField("Reason", reason);
- let reportschannel = bot.channels.find('name', "reports");
- if(!reportschannel) return message.channel.send("Couldn't find reports channel.");
- message.delete().catch(O_o=>{});
- reportschannel.send(reportEmbed);
- }
- if(message.content.startsWith(`SALkick`)){
- let kUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
- if(!kUser) return message.channel.send("Can't find user!");
- let kReason= args.join(" ").slice(22);
- if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("No can do pal!");
- if(kUser.hasPermission("KICK_MEMBERS")) return message.channel.send("That person can't be kicked");
- let kickEmbed = new Discord.RichEmbed()
- .setDescription("~Kick~")
- .setColor("#f7e202")
- .addField("Kicked User", `${kUser} with ID ${kUser.id}`)
- .addField("Kicked By", `<@${message.author.id}> with ID ${message.author.id}`)
- .addField("Kicked In", message.channel)
- .addField("Time", message.createdAt)
- .addField("Reason", kReason);
- let kickChannel = bot.channels.find('name', "kicks-and-bans");
- if(!kickChannel) return message.channel.send("Can't find kick channel.");
- message.guild.member(kUser).kick(kReason);
- kickChannel.send(kickEmbed);
- }
- if(message.content.startsWith(`SALban`)){
- let bUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
- if(!bUser) return message.channel.send("Can't find user!");
- let bReason= args.join(" ").slice(22);
- if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("No can do pal!");
- if(bUser.hasPermission("KICK_MEMBERS")) return message.channel.send("That person can't be Banned");
- let banEmbed = new Discord.RichEmbed()
- .setDescription("~Ban~")
- .setColor("#f442d4")
- .addField("Ban User", `${bUser} with ID ${bUser.id}`)
- .addField("Banned By", `<@${message.author.id}> with ID ${message.author.id}`)
- .addField("Banned In", message.channel)
- .addField("Time", message.createdAt)
- .addField("Reason", bReason);
- let kickChannel = bot.channels.find('name', "kicks-and-bans");
- if(!kickChannel) return message.channel.send("Can't find kick channel.");
- message.guild.member(bUser).ban(bReason);
- kickChannel.send(banEmbed);
- }
- if (message.channel.id === "486746838352003075") {
- if(isNaN(message.content)) {
- message.delete()
- message.author.send("No messaging in that channel!")
- }
- }
- if (message.channel.id === "486921615087763457") {
- if(isNaN(message.content)) {
- message.delete()
- message.author.send("No messaging in that channel!")
- }
- }
- if(message.content.toLowerCase() == "ligma") {
- message.delete()
- message.reply("hey! That word isnβt allowed here!")
- }
- });
- bot.on("ready", function(){
- console.log(`
- READY!
- /$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$$$$$$ /$$
- /$$__ $$ /$$__ $$| $$ | $$ | $$ | $$__ $$ | $$
- | $$ \__/| $$ \ $$| $$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$$$$$
- | $$$$$$ | $$$$$$$$| $$ |_ $$_/ | $$ | $$ /$$__ $$ /$$__ $$|_ $$_/ | $$$$$$$ /$$__ $$|_ $$_/
- \____ $$| $$__ $$| $$ | $$ | $$ | $$| $$$$$$$$| $$$$$$$$ | $$ | $$__ $$| $$ \ $$ | $$
- /$$ \ $$| $$ | $$| $$ | $$ /$$| $$ | $$| $$_____/| $$_____/ | $$ /$$| $$ \ $$| $$ | $$ | $$ /$$
- | $$$$$$/| $$ | $$| $$$$$$$$| $$$$/| $$$$$$$| $$$$$$$| $$$$$$$ | $$$$/| $$$$$$$/| $$$$$$/ | $$$$/
- \______/ |__/ |__/|________/ \___/ \____ $$ \_______/ \_______/ \___/ |_______/ \______/ \___/
- /$$ | $$
- | $$$$$$/
- \______/
- `)
- });
- bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement