Advertisement
Guest User

Untitled

a guest
Sep 5th, 2018
1,428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Commando = require("discord.js-commando")
  2. const Discord = require("discord.js")
  3. const bot = new Commando.Client();
  4. const token = "my token goes gere";
  5. const botconfig = require("./botconfig.json");
  6. const economy = require("discord-eco")
  7. const dba = require('discord-dba');
  8. const fs = require("fs");
  9. const mysql = require('mysql');
  10. const express = require('express')
  11. const Client = require('fortnite')
  12. const fortnite = new Client("aaed04ee-dec9-4b32-bfce-0fca0cbf7f34");
  13. let prefix2 = '!';
  14. var app = express();
  15. var connection = mysql.createConnection({
  16.     host: 'localhost',
  17.     user: 'root',
  18.     password: '',
  19.     database: 'sampleDB'
  20. });
  21. let coins = require("./commands/economy/coins.json");
  22. bot.registry.registerGroup('simple', 'Simple');
  23. bot.registry.registerGroup('music', 'music');
  24. bot.registry.registerGroup('economy', 'economy');
  25. bot.registry.registerCommandsIn(__dirname + '/commands');
  26. bot.registry.registerDefaults();
  27. bot.on("message", function(message){
  28. let prefix = '!';
  29.  
  30. if(message.content == "hello"){
  31. message.channel.sendMessage("Hello!" + message.author +  ",how are you?")
  32. }
  33.  
  34. if (message.content.startsWith("krabby patty")) {
  35.     message.channel.send("PREPARING THE KRABBY PATTY!", {files: ["./images/patty.png"]});
  36.     return;
  37.     }
  38. if (message.content === "ping"){
  39.     message.channel.send("Pong!");
  40.     return;
  41. }
  42. if (message.content === "what do i look like") {
  43.     message.channel.send(message.author.avatarURL);
  44.     message.channel.send("Also UGLY As Fuck");
  45.     return;
  46. }
  47.  
  48. //Test Economy
  49. if (message.content === "payday") {
  50.     economy.updateBalance(message.author.id, 500).then((i) => {
  51.         message.channel.send(`**You got $500**\n**New Balance:** ${i.money}`);
  52.     })
  53. }
  54. if (message.content === "balance") {
  55.  
  56.     economy.fetchBalance(message.author.id).then((i) => { // economy.fetchBalance grabs the userID, finds it, and puts it into 'i'.
  57.         message.channel.send(`**Balance:** ${i.money}`);
  58.     })
  59.  
  60.  
  61. }
  62. if (message.content === "payfine") {
  63.  
  64.     economy.updateBalance(message.author.id, -500).then((i) => { // Since the 'value' is -500, it will 'add' -500, making the balance $500 lower.
  65.         message.channel.send(`**You paid your fine of $500!**\n**New Balance:** ${i.money}`);
  66.     })
  67.  
  68. }
  69. if (message.content === "meme")/*if you want to start with the prefix just do if (message.startsWith (prefix + "meme"))*/ {
  70.     number = 302;
  71.     imageNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
  72.     message.channel.send ({files: ["./images/memes/" + imageNumber + ".png"]})
  73. }
  74. if (message.content === "SALbotinfo"){
  75.     let bicon = bot.user.displayAvatarURL;
  76.     let botembed = new Discord.RichEmbed()
  77.     .setDescription("Bot Information")
  78.     .setColor("#51ff77")
  79.     .setThumbnail(bicon)
  80.     .addField("Bot Name", bot.user.username)
  81.     .addField("Created On", bot.user.createdAt);
  82. return message.channel.send(botembed);
  83. }
  84.  
  85. if (message.content === "SALserverinfo"){
  86.     let sicon = message.guild.iconURL;
  87.     let serverembed = new Discord.RichEmbed()
  88.     .setDescription("Server Information")
  89.     .setColor("#51ffff")
  90.     .setThumbnail(sicon)
  91.     .addField("Server Name", message.guild.name)
  92.     .addField("Created On", message.guild.createdAt)
  93.     .addField("You Joined", message.member.joinedAt)
  94.     .addField("Total Members", message.guild.memberCount);
  95.     return message.channel.send(serverembed);
  96. }
  97. if(message.content == `SALreport`){
  98.     let rUSer = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
  99.     if(!rUSer) return message.channel.send("Couldn't find user.");
  100.     let reason = args.join(" ").slice(22);
  101.     let reportEmbed = new Discord.RichEmbed()
  102.     .setDescription("Reports")
  103.     .setColor("#15f")
  104.     .addField("Reported User", `${rUSer} with ID: ${rUser.id}`)
  105.     .addField("Reported By", `${message.author} with ID: ${message.author.id}`)
  106.     .addField("Channel", message.channel)
  107.     .addField("Time", message.createdAt)
  108.     .addField("Reason", reason);
  109.     let reportschannel = message.guild.channel.find(`name`, "reports");
  110.     if(!reportschannel) return message.channel.send("Couldn't find reports channel.");
  111.     message.delete().catch(O_o=>{});
  112.     reportschannel.send(reportEmbed);
  113.  
  114. }
  115. });
  116. bot.on("ready", function(){
  117.     console.log(`
  118.     READY!
  119.    
  120.   /$$$$$$   /$$$$$$  /$$       /$$                                     /$$     /$$$$$$$              /$$    
  121.   /$$__  $$ /$$__  $$| $$      | $$                                    | $$    | $$__  $$            | $$    
  122.  | $$  \__/| $$  \ $$| $$     /$$$$$$   /$$   /$$  /$$$$$$   /$$$$$$  /$$$$$$  | $$  \ $$  /$$$$$$  /$$$$$$  
  123.  |  $$$$$$ | $$$$$$$$| $$    |_  $$_/  | $$  | $$ /$$__  $$ /$$__  $$|_  $$_/  | $$$$$$$  /$$__  $$|_  $$_/  
  124.   \____  $$| $$__  $$| $$      | $$    | $$  | $$| $$$$$$$$| $$$$$$$$  | $$    | $$__  $$| $$  \ $$  | $$    
  125.   /$$  \ $$| $$  | $$| $$      | $$ /$$| $$  | $$| $$_____/| $$_____/  | $$ /$$| $$  \ $$| $$  | $$  | $$ /$$
  126.  |  $$$$$$/| $$  | $$| $$$$$$$$|  $$$$/|  $$$$$$$|  $$$$$$$|  $$$$$$$  |  $$$$/| $$$$$$$/|  $$$$$$/  |  $$$$/
  127.   \______/ |__/  |__/|________/ \___/   \____  $$ \_______/ \_______/   \___/  |_______/  \______/    \___/  
  128.                                         /$$  | $$                                                            
  129.                                        |  $$$$$$/                                                            
  130.                                         \______/                                                            
  131.  `)
  132. });
  133.  
  134.  
  135. bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement