mirror of
https://github.com/musix-org/musix-oss
synced 2024-11-10 05:10:17 +00:00
Update play.js
This commit is contained in:
parent
a35355c669
commit
32c476a3f6
@ -1,7 +1,9 @@
|
||||
const YouTube = require("simple-youtube-api");
|
||||
const search = require("yt-search");
|
||||
const SpotifyApi = require("spotify-web-api-node");
|
||||
const { globaldb } = require("../../index.js");
|
||||
const {
|
||||
globaldb
|
||||
} = require("../../index.js");
|
||||
|
||||
module.exports = {
|
||||
name: "play",
|
||||
@ -17,16 +19,7 @@ module.exports = {
|
||||
secret: client.config.spotify_client_secret,
|
||||
});
|
||||
|
||||
const dbdata = await globaldb
|
||||
.collection("guilds")
|
||||
.doc(msg.guild.id)
|
||||
.get()
|
||||
.catch((err) => {
|
||||
console.log("Error getting document", err);
|
||||
return "error";
|
||||
});
|
||||
const accessKey = dbdata.data();
|
||||
spotify.setAccessToken(accessKey);
|
||||
spotify.setAccessToken(client.config.spotify_access_key);
|
||||
|
||||
const youtube = new YouTube(client.config.api_key);
|
||||
const searchString = args.slice(1).join(" ");
|
||||
|
Loading…
Reference in New Issue
Block a user