Advertisement
Guest User

Untitled

a guest
Jun 16th, 2017
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js')
  2. const ytdl = require('ytdl-core')
  3. const music = require('discord.js-music-v11')
  4. const bot = new Discord.Client();
  5. const path = require('path');
  6.  
  7. function cmd(str, msg){
  8.     return msg.content.startsWith("!" + str);
  9. }
  10.  
  11. const imgPath = path.join(__dirname, './Images');
  12. var timeNow = new Date();
  13. var sth;
  14. var stm;
  15. var sts;
  16. var isPrinted = false;
  17. var timeh = sth - timeNow.getHours();
  18. var timem = stm - timeNow.getMinutes();
  19.  
  20. bot.on('ready', (message) =>{
  21.     console.log("AhriBot is online.");
  22.     bot.user.setGame("!help for commands");
  23. });
  24.  
  25. music(bot, {
  26.     prefix: '!',
  27.     golbal: false,
  28.     maxQueueSize: '25',
  29.     clearInvoker: false
  30. });
  31.  
  32. bot.on('message', (message) =>{
  33.     var args = message.content.split(/[ ]+/);
  34.  
  35.     if(cmd('st', message)){
  36.         message.reply("The stream should be starting at " + sth + "h:" + stm + "m  on " + sts + ".");
  37.     }
  38.    
  39.     if(cmd('guns', message)){
  40.         message.channel.send("̿̿ ̿̿ ̿̿ ̿'̿'͇̿̿= ( ▀ ͜͞ʖ▀) =ε/̵͇̿̿/’̿’̿ ̿ ̿̿ ̿̿ ̿̿");
  41.     }
  42.    
  43.     if(cmd('love', message)){
  44.         message.channel.send('', {files: ['Images/img01.png']});
  45.     }
  46.    
  47.     if(cmd('angry', message)){
  48.         message.channel.send('', {files: ['Images/img02.png']});
  49.     }
  50.    
  51.     if(cmd('mlg', message)){
  52.         message.channel.send('', {files: ['Images/mlg.png']});
  53.     }
  54.  
  55.     if(cmd('restart', message)){
  56.       process.exit(0);
  57.     }
  58.  
  59.     if(cmd('roll', message)){
  60.         if(message.member.roles.some(r=> ["CRIB MASTER", "CRIB DONATORS", "CRIB moderators"].includes(r.name) )) {
  61.             var dice = Math.floor(Math.random() * 11);
  62.  
  63.             message.channel.send("The number is: " + dice);
  64.         }
  65.     }
  66.  
  67.     if(cmd('info', message)){
  68.         message.reply("__media sites:__ \nYoutube: https://www.youtube.com/c/CornyCornflake \nTwitter: https://twitter.com/Corny_Cornflake \nTwitch: https://www.twitch.tv/cornycornflake\n\n __Donation Site:__\n\nhttps://www.tipeeestream.com/cornycornflake/donation");
  69.     }
  70.  
  71.     if(cmd('help', message)){
  72.         message.reply("Sent you the commands on dms ;)");
  73.         message.author.send("__Normal Commands:__ \n\n`!st` for stream info\n`!info` for Cornys social media info\n\n__Music__\n\n`!play` (<url>|<search string>): Play a video/music. It can take a URL from various services (YouTube, Vimeo, YouKu, etc). You can also search using a string.\n\n`!skip [number]`: Skip some number of songs. Will skip 1 song if a number is not specified.\n\n`!queue`: Display the current queue.\n\n`!pause`: Pause music playback. (requires music manager)\n\n`!resume`: Resume music playback. (requires music manager)\n\n`!volume`: Adjust the playback volume between 1 and 200 (requires music manager)\n\n`!leave`: Clears the song queue and leaves the channel.\n\n`!clearqueue`: Clears the song queue.\n\n__For Fun__\n\n`!guns` for a cool emoji \n\n`!love` ahri will give you some love\n\n`!mlg` When she does something epic!\n\n`!angry` See her reaction when she is angry\n\n__Admin Commands:__\n\n`!setst <hour> <minutes> <site>` for setting the stream time and site\n`!roll` To roll a random number from 1 to 10\n\n`!restart` To reload all the code");
  74.     }
  75.  
  76.     if(cmd('ping', message)){
  77.          message.reply("Pong! " + bot.ping + "ms");
  78.     }
  79.  
  80.     if(cmd('setst', message)){
  81.         if(message.member.roles.some(r=> ["CRIB MASTER", "CRIB DONATORS", "CRIB moderators"].includes(r.name) )) {
  82.             if(isNaN(args[1])){
  83.                 message.reply("Not a number. Please enter a number");
  84.             }else if(args[1] === 0 && args[1] === 1){
  85.                 message.reply("Error, Not a valid number. Please enter like the following. 13, 01, 06, 23");
  86.             }else if(args[1] >= 24){
  87.                 message.reply("Please learn the clock")
  88.             }
  89.             else{
  90.                 message.reply("hour set");
  91.                 sth = args[1];
  92.             }
  93.             if(isNaN(args[2])){
  94.                 message.reply("Not a valid number")
  95.             }else if(args[2] === 0 && args[2] === 1){
  96.                 message.reply("Please enter the minutes as two numbers. Please enter like the following. 13, 01, 43, 50")
  97.             }else if(args[2] >= 60){
  98.                 message.reply("Please learn the clock");
  99.             }
  100.             else{
  101.                 message.reply("minutes set")
  102.                 stm = args[2];
  103.             }
  104.             if(args[3] === " "){
  105.                 message.reply("Enter a streaming site please `!setst <hour> <minutes> <site>`");
  106.             }else{
  107.                 message.reply("Site set");
  108.                 sts = args[3];
  109.             }
  110.         }else{
  111.             message.reply("Not enough role premissions");
  112.         }
  113.     }
  114. });
  115.  
  116. bot.login('MzIw');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement