summaryrefslogtreecommitdiff
path: root/src/commands/voice/volume.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/voice/volume.ts')
-rw-r--r--src/commands/voice/volume.ts21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/commands/voice/volume.ts b/src/commands/voice/volume.ts
index 4851ee7..5678101 100644
--- a/src/commands/voice/volume.ts
+++ b/src/commands/voice/volume.ts
@@ -1,8 +1,9 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
+import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
+//@ts-ignore
import emoji from 'emoji-random';
module.exports = class VolumeVoice extends Command {
- constructor(client) {
+ constructor(client: CommandoClient) {
super(client, {
name: 'volume',
aliases: ['vol'],
@@ -15,7 +16,7 @@ module.exports = class VolumeVoice extends Command {
key: 'wantedVol',
prompt: 'What would volume you like? (1 to 200)',
type: 'integer',
- validate: wantedVol => wantedVol >= 1 && wantedVol <= 200
+ validate: (wantedVol: number) => wantedVol >= 1 && wantedVol <= 200
}
],
examples: [
@@ -30,20 +31,22 @@ module.exports = class VolumeVoice extends Command {
},
});
}
- run(msg: CommandoMessage, { wantedVol }) {
+ run(msg: CommandoMessage, { wantedVol }: any) {
var voiceChannel = msg.member.voice.channel;
if (!voiceChannel) return msg.reply('Please join a channel and try again. ' + emoji.random());
- if (
- typeof msg.guild.musicData.songDispatcher == 'undefined' ||
- msg.guild.musicData.songDispatcher == null
- ) {
+ //@ts-ignore
+ if (typeof msg.guild.musicData.songDispatcher == 'undefined' ||
+ //@ts-ignore
+ msg.guild.musicData.songDispatcher == null) {
return msg.reply('There isn\'t any audio playing right now. ' + emoji.random());
}
const volume = wantedVol / 100;
+ //@ts-ignore
msg.guild.musicData.volume = volume;
+ //@ts-ignore
msg.guild.musicData.songDispatcher.setVolume(volume);
- msg.reply(`Volume is now: **${wantedVol}%**. ` + emoji.random());
+ return msg.reply(`Volume is now: **${wantedVol}%**. ` + emoji.random());
}
}; \ No newline at end of file