Optimisations

This commit is contained in:
hydrabolt
2015-11-07 18:39:22 +00:00
parent be1f5064c2
commit af8da5b0a2
8 changed files with 229 additions and 74 deletions

View File

@@ -9,7 +9,7 @@ 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 === "$$$"){
if(m.content === "&init"){
for(var channel of m.channel.server.channels){
if(channel instanceof VoiceChannel){
a.internal.joinVoiceChannel(channel).catch(error);
@@ -17,6 +17,19 @@ a.on("message", m => {
}
}
}
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]){
connection = a.internal.voiceConnections[chan];
connection
}
}
});
function error(e){