mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Updated bod
This commit is contained in:
@@ -9,6 +9,7 @@ client.on("message", m => {
|
|||||||
if (m.content === "&init") {
|
if (m.content === "&init") {
|
||||||
for (var channel of m.channel.server.channels) {
|
for (var channel of m.channel.server.channels) {
|
||||||
if (channel instanceof Discord.VoiceChannel) {
|
if (channel instanceof Discord.VoiceChannel) {
|
||||||
|
client.reply(m, channel.name + " - " + channel.id);
|
||||||
client.joinVoiceChannel(channel).catch(error);
|
client.joinVoiceChannel(channel).catch(error);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -30,17 +31,25 @@ client.on("message", m => {
|
|||||||
var connection = client.internal.voiceConnection;
|
var connection = client.internal.voiceConnection;
|
||||||
connection.playFile("C:/users/amish/desktop/" + rest);
|
connection.playFile("C:/users/amish/desktop/" + rest);
|
||||||
}
|
}
|
||||||
} if (m.content.startsWith("$pipebitch")) {
|
} if (m.content.startsWith("pipeit")) {
|
||||||
var chan;
|
var chan;
|
||||||
var rest = m.content.split(" ");
|
var rest = m.content.split(" ");
|
||||||
rest.splice(0, 1);
|
rest.splice(0, 1);
|
||||||
rest = rest.join(" ");
|
rest = rest.join(" ");
|
||||||
|
|
||||||
if (client.internal.voiceConnection) {
|
if (client.internal.voiceConnection) {
|
||||||
client.reply(m, "ok, I'll play that for you " + rest);
|
|
||||||
var connection = client.internal.voiceConnection;
|
var connection = client.internal.voiceConnection;
|
||||||
|
|
||||||
connection.playFile(rest);
|
connection.playFile(rest).then(intent => {
|
||||||
|
client.reply(m, "playing!").then((msg) => {
|
||||||
|
|
||||||
|
intent.on("end", () => {
|
||||||
|
client.updateMessage(msg, "that song has finished now.");
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user