Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bot.on("ready", async music => {
  2.   function play(){
  3.     let VC = bot.channels.get("535172887737401350");
  4.     VC.join()
  5.       .then(connection => {
  6.         const dispatcher = connection.playFile(`./audio/music`+ randint(66) +`.mp3`);
  7.         dispatcher.on("end", end => {
  8.           play()
  9.         });
  10.       })
  11.       .catch(console.error)
  12.   };
  13.   play()
  14.  
  15.   setInterval(function () {
  16.     var date = new Date()
  17.     if(date.getMinutes() == 01 && date.getSeconds() == 10){
  18.       let VC = bot.channels.get("535172887737401350");
  19.       VC.join()
  20.         .then(connection => {
  21.           const dispatcher = connection.playFile(`./audio/cd.mp3`);
  22.           console.log("I am here")
  23.           dispatcher.on("end", end => {
  24.             dispatcher.end()
  25.             play()
  26.           });
  27.         })
  28.         .catch(console.error)
  29.     };
  30.   }, 600);
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement