From 67d5f9d63e663e5728057740018100dcb41d87cd Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Sat, 7 Nov 2015 21:39:32 +0000 Subject: [PATCH] Updated index.js to not run --- lib/index.js | 113 +++++++-------------------------------------------- src/index.js | 70 +++++++------------------------ 2 files changed, 28 insertions(+), 155 deletions(-) diff --git a/lib/index.js b/lib/index.js index f959665c6..31c91c19c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,102 +1,17 @@ "use strict"; module.exports = { - Client: require("./Client/Client.js") -}; - -var VoiceChannel = require("./Structures/VoiceChannel.js"); - -var a = new module.exports.Client(); -a.on("debug", function (m) { - return console.log("[debug]", m); -}); -a.on("warn", function (m) { - return console.log("[warn]", m); -}); -var start = Date.now(); -a.on("message", function (m) { - if (m.content === "&init") { - for (var _iterator = m.channel.server.channels, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var channel = _ref; - - if (channel instanceof VoiceChannel) { - a.joinVoiceChannel(channel)["catch"](error).then(function (connection) { - connection.playFile("C:/users/amish/desktop/asdf.mp3"); - }); - break; - } - } - } - if (m.content.startsWith("$$$ stop")) { - for (var _iterator2 = m.channel.server.channels, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - var channel = _ref2; - - 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 _iterator3 = m.channel.server.channels, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { - var _ref3; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref3 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref3 = _i3.value; - } - - var channel = _ref3; - - 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"](function (e) { - return console.log(e); -}); \ No newline at end of file + 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") +}; \ No newline at end of file diff --git a/src/index.js b/src/index.js index 5adc554f5..593ec36b5 100644 --- a/src/index.js +++ b/src/index.js @@ -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)); \ No newline at end of file + 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"), +} \ No newline at end of file