SHARE
TWEET

welcome voice

MrWolf_1sT Feb 14th, 2020 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const getYoutubeID = require("get-youtube-id");
  2. const fetchVideoInfo = require("youtube-info");
  3. const YouTube = require("simple-youtube-api");
  4. const youtube = new YouTube("AIzaSyAdORXg7UZUo7sePv97JyoDqtQVi3Ll0b8");
  5. const queue = new Map();
  6. const yt = require("ytdl-core");
  7.  
  8. client.on("voiceStateUpdate", (oldMember, newMember) => {
  9.   if (
  10.     oldMember.voiceChannel === undefined &&
  11.     newMember.voiceChannel !== undefined
  12.   ) {
  13.     const voiceChannel = client.channels.get("647517434990821401");
  14.     voiceChannel.join().then(connnection => {
  15.       let disp = yt("https://www.youtube.com/watch?v=TVo_H8fAN9k", {
  16.         audioonly: true
  17.       });
  18.       const dispatcher = connnection.playStream(disp);
  19.     });
  20.   } else if (newMember.voiceChannel === undefined) {
  21.     const voiceChannel = client.channels.get("647517434990821401");
  22.     voiceChannel.leave();
  23.   }
  24. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top