This repository has been archived by the owner on Feb 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
TEST.js
52 lines (44 loc) · 1.72 KB
/
TEST.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
μBot v5.0 Test.
---------------------
PMH Studio / Proj- μBot | Smart & Cute Discord Bot_Mu~☆
Copyright (c) 2018. PMH Studio / PMH. ([email protected]) MIT Licensed.
* Requests Node.js & Discord.js
*/
console.log("------------------MuBot------------------------");
// API Require
console.log("Main API Load...");
const API = require("discord.js"); // Main API
console.log("Main API Loaded Correctly");
// TTS Require
console.log("TTS API(Google TTS Library) Load...");
const TTS = require("google-tts-api");
console.log("TTS API Loaded Correctly");
// Command Reader Require
console.log("Command Reader Load...");
const cmds = require("fs");
console.log("Reader Loaded Correctly");
// Login Require
console.log("Token Load...");
const token = process.env.token; // Set Bot Token
console.log("Token Loaded Correctly");
console.log("Discord API Client Login");
const mu = new API.Client(); // Take a Bot From Main API
console.log("Login Correctly");
console.log("Command Load...");
mu.commands = new API.Collection();
cmds.readdir("./muc/", (err, files) => {
if (err) { console.log("\n\nRead Commands Error!______________________________\n\n" + err); }
let jsfile = files.filter((f) => f.split(".").pop() === "js");
if(jsfile.length <= 0){
console.log("Error( E404): Couldn't find commands.");
}
jsfile.forEach((f, i) => {
let props = require(`./muc/${f}`);
console.log(`CommandLoad: Ready(${f})`);
mu.commands.set(props.help.name, props);
});
});
console.log("Returning Code: 0");
console.log(" μBot v7.0 Test.\n ---------------------\n PMH Studio / Proj- μBot | Smart & Cute Discord Bot_Mu~☆ \n Copyright (c) 2018. PMH Studio. ([email protected]) MIT Licensed.\n\n\n");
return console.log("----------------------------------------");