This repository was archived by the owner on Aug 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpause.js
55 lines (49 loc) · 1.53 KB
/
pause.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const langfile = require("../storage/translation/language.json")
module.exports.run = async (client, message, args) => {
if (!client.premium) {
}
const prefix = client.prefix
let lan
if (client.language == "eng") {
lan = langfile.english.music.pause
}
if (client.language == "ger") {
lan = langfile.german.music.pause
}
if (client.language == "fr") {
lan = langfile.french.music.pause
}
if (client.language == "cz") {
lan = langfile.czech.music.pause
}
if (client.language == "ru") {
lan = langfile.russian.music.pause
}
if (message.member.voiceChannel) {//commander is in voiceChannel
if (message.guild.voiceConnection) {//I'm in voiceChannel
if (message.member.voiceChannel.id === message.guild.voiceConnection.channel.id) {//IDs of my Voicechannel and commander's one are same -> we are in the same voiceChannel
message.guild.voiceConnection.dispatcher.setPaused(true);
message.guild.voiceConnection.dispatcher.pause();
message.channel.send(lan.toggle)
}
else {
message.channel.send(lan.wrongchannel);
}
}
else {
message.channel.send(lan.nomusic);
}
}
else {
message.channel.send(lan.nochannel);
}
}
module.exports.help = {
name: "pause",
description: "Pauses playing music.",
aliases: [],
permlvl: 1,
hidden: false,
category: "music",
usage: "pause"
}