mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Updated index.js to not run
This commit is contained in:
70
src/index.js
70
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));
|
||||
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"),
|
||||
}
|
||||
Reference in New Issue
Block a user