From 3532cc00d34bdd22386d29ad41b2de8ca9e341d7 Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Tue, 21 Apr 2020 14:29:36 +0300 Subject: [PATCH] fix --- config/serviceAccount.json | 12 ------------ index.js | 18 +++--------------- src/commands/play.js | 3 --- src/events/clientEvents/msg.js | 4 +--- src/events/clientEvents/ready.js | 4 ++-- src/struct/client.js | 2 +- {config => src/struct/config}/config.js | 0 web/app.js | 2 +- 8 files changed, 8 insertions(+), 37 deletions(-) delete mode 100644 config/serviceAccount.json rename {config => src/struct/config}/config.js (100%) diff --git a/config/serviceAccount.json b/config/serviceAccount.json deleted file mode 100644 index 39f4279d..00000000 --- a/config/serviceAccount.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "service_account", - "project_id": "global-1f5f9", - "private_key_id": "b5a6a0b88ae6140663840979255664efe81686b6", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDHtsqPN7JDzx/Z\n1V09wgEjytB+OpAZPWWRl42QGfAEhynYBXcQSOdXA6azZPfZvl+E2D5A48Ok/v47\nsruqLC5AWaA1uz53FbtyqH1AyMNG5bZIPyteR36yQzwJvqjVlufWG93v2htJt6bw\nl3tJva7/xYlTBBtoxuoZpHSKtKxNG5j2acPm31BZc3f+3KM6PCA6ZBnC/CiNOY37\nKEC1iLALK206ByU9WcVJo6yS49WufIfBOVFzYJVGdXy3ekGOnBfW1TlHSLiuw+qN\nMvLV8+yj9KxQfJ2oAnoYJwV9tboSTkDRu519izamGLBtiiPfSa4LSOcfPRcklO07\ncIYjq8WxAgMBAAECggEABPSr+5hP999KpMrm3Kq1AQieGlfFLh8oJ0/5rw75tf8N\nooLmNLT+apoYV6DEhrZy49bC2rTcLLq4H86cWgltH2Mp9tNd5jIXm+2C6CnjMJ3w\nI0RQBO+kvPMuqPY+dchgGd/IptREc5SXU6aKpGaM0mN6OCF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tF7DbnMTXl6Wo8Ggsaj0\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-nckf2@global-1f5f9.iam.gserviceaccount.com", - "client_id": "116364112880753391831", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-nckf2%40global-1f5f9.iam.gserviceaccount.com" -} diff --git a/index.js b/index.js index 1ce43182..452cfea0 100644 --- a/index.js +++ b/index.js @@ -1,17 +1,4 @@ -const config = require("./config/config.js"); -/*const admin = require("firebase-admin"); -const serviceAccount = require("./config/serviceAccount.json"); -const secondaryAppConfig = { - credential: admin.credential.cert(serviceAccount), - databaseURL: "https://global-1f5f9.firebaseio.com", -}; -const secondary = admin.initializeApp(secondaryAppConfig, "secondary"); -const globaldb = secondary.database(); -const global = { - db: { - guilds: {}, - }, -};*/ +const config = require("./src/struct/config/config.js"); if (config.devMode) { console.log("- dev mode- "); @@ -32,4 +19,5 @@ console.log("- Launching shards -"); manager.spawn(config.shards, config.shardDelay, config.shardTimeout); manager.on("shardCreate", (shard) => console.log(`- Launched shard ${shard.id} -`) -); \ No newline at end of file +); +//require("./src/bot.js"); \ No newline at end of file diff --git a/src/commands/play.js b/src/commands/play.js index 84e17fb7..223ab9ce 100644 --- a/src/commands/play.js +++ b/src/commands/play.js @@ -1,9 +1,6 @@ const YouTube = require("simple-youtube-api"); const search = require("yt-search"); const SpotifyApi = require("spotify-web-api-node"); -const { - globaldb -} = require("../../index.js"); module.exports = { name: "play", diff --git a/src/events/clientEvents/msg.js b/src/events/clientEvents/msg.js index 74032272..b4d54773 100644 --- a/src/events/clientEvents/msg.js +++ b/src/events/clientEvents/msg.js @@ -1,5 +1,3 @@ -const { db } = require("../../../index-.js"); - module.exports = { name: "message", async execute(client, msg, Discord) { @@ -50,4 +48,4 @@ module.exports = { return msg.channel.send(client.messages.devMode); client.funcs.exe(msg, args, client, Discord, command); }, -}; +}; \ No newline at end of file diff --git a/src/events/clientEvents/ready.js b/src/events/clientEvents/ready.js index 93c3b118..18e0a763 100644 --- a/src/events/clientEvents/ready.js +++ b/src/events/clientEvents/ready.js @@ -26,7 +26,7 @@ module.exports = { }; }); } - console.log(`- DB Set - Shard: ${client.shard.ids} -`); + console.log(`- DB Set - Shard:${client.shard.ids} -`); client.user.setActivity(`@${client.user.username} help | 🎶`, { type: "LISTENING", }); @@ -54,4 +54,4 @@ module.exports = { client.funcs.ffmpeg(client, Discord); }, 7200000); }, -}; +}; \ No newline at end of file diff --git a/src/struct/client.js b/src/struct/client.js index a7fb1238..14a0752b 100644 --- a/src/struct/client.js +++ b/src/struct/client.js @@ -24,7 +24,7 @@ module.exports = class extends Client { this.queue = new Map(); this.funcs = {}; this.dispatcher = {}; - this.config = require("../../config/config.js"); + this.config = require("./config/config.js"); this.messages = require("./config/messages.js"); this.db = admin.firestore(); this.db.FieldValue = require("firebase-admin").firestore.FieldValue; diff --git a/config/config.js b/src/struct/config/config.js similarity index 100% rename from config/config.js rename to src/struct/config/config.js diff --git a/web/app.js b/web/app.js index 8f4af3bd..a47a2de8 100644 --- a/web/app.js +++ b/web/app.js @@ -1,4 +1,4 @@ -const config = require("../config/config.js"); +const config = require("../src/struct/config/config.js"); const express = require("express"); // Express web server framework const request = require("request"); // "Request" library const cors = require("cors");