Updated index.js to not run

This commit is contained in:
hydrabolt
2015-11-07 21:39:32 +00:00
parent f5640fa5d0
commit 67d5f9d63e
2 changed files with 28 additions and 155 deletions

View File

@@ -1,57 +1,15 @@
module.exports = {
Client : require("./Client/Client.js")
}
var VoiceChannel = require("./Structures/VoiceChannel.js");
var a = new module.exports.Client();
a.on("debug", (m) => console.log("[debug]",m));
a.on("warn", (m) => console.log("[warn]", m));
var start = Date.now();
a.on("message", m => {
if(m.content === "&init"){
for(var channel of m.channel.server.channels){
if(channel instanceof VoiceChannel){
a.joinVoiceChannel(channel).catch(error)
.then(connection => {
connection.playFile("C:/users/amish/desktop/asdf.mp3");
});
break;
}
}
}
if(m.content.startsWith("$$$ stop")){
for(var channel of m.channel.server.channels){
if(channel instanceof VoiceChannel){
chan = channel;
break;
}
}
if(a.internal.voiceConnections[chan]){
var connection = a.internal.voiceConnections[chan];
connection.stopPlaying();
}
return;
}
if(m.content.startsWith("$$$")){
var chan;
for(var channel of m.channel.server.channels){
if(channel instanceof VoiceChannel){
chan = channel;
break;
}
}
if(a.internal.voiceConnections[chan]){
var connection = a.internal.voiceConnections[chan];
connection.playFile("C:/users/amish/desktop/asdf.mp3");
}
}
});
function error(e){
console.log(e.stack);
process.exit(0);
}
a.login(process.env["discordEmail"], process.env["discordPass"]).catch((e)=>console.log(e));
Client : require("./Client/Client"),
Channel : require("./Structures/Channel"),
ChannelPermissions : require("./Structures/ChannelPermissions"),
Invite : require("./Structures/Invite"),
Message : require("./Structures/Message"),
PermissionOverwrite : require("./Structures/PermissionOverwrite"),
PMChannel : require("./Structures/PMChannel"),
Role : require("./Structures/Role"),
Server : require("./Structures/Server"),
ServerChannel : require("./Structures/ServerChannel"),
TextChannel : require("./Structures/TextChannel"),
User : require("./Structures/User"),
VoiceChannel : require("./Structures/VoiceChannel"),
}