aboutsummaryrefslogtreecommitdiff
path: root/src/commands/remove.ts
diff options
context:
space:
mode:
authorDrunkenToast <[email protected]>2021-11-20 21:34:56 +0100
committerMax Isom <[email protected]>2021-11-20 19:01:53 -0500
commit7538a2ebb8bc111bd974eab7d037e8a4a558a10a (patch)
tree778e0d9ee556c0b765064ad3fc1559c393d4de67 /src/commands/remove.ts
parentfe233cb98ce460dccb5d799de00671b6a57f2202 (diff)
downloadmuse-7538a2ebb8bc111bd974eab7d037e8a4a558a10a.tar.xz
muse-7538a2ebb8bc111bd974eab7d037e8a4a558a10a.zip
fix: loading message isn't required
Diffstat (limited to 'src/commands/remove.ts')
-rw-r--r--src/commands/remove.ts22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/commands/remove.ts b/src/commands/remove.ts
index e098484..bdca944 100644
--- a/src/commands/remove.ts
+++ b/src/commands/remove.ts
@@ -1,9 +1,8 @@
-import {Message, TextChannel} from 'discord.js';
+import {Message} from 'discord.js';
import {inject, injectable} from 'inversify';
import {TYPES} from '../types.js';
import PlayerManager from '../managers/player.js';
import Command from '.';
-import LoadingMessage from '../utils/loading-message.js';
import errorMsg from '../utils/error-msg.js';
@injectable()
@@ -24,11 +23,8 @@ export default class implements Command {
public async execute(msg: Message, args: string []): Promise<void> {
const player = this.playerManager.get(msg.guild!.id);
- const res = new LoadingMessage(msg.channel as TextChannel);
- await res.start();
-
if (args.length === 0) {
- await res.stop('atleast give me a clue for which song you want to remove');
+ await msg.channel.send('atleast give me a clue for which song you want to remove');
return;
}
@@ -36,7 +32,7 @@ export default class implements Command {
const match = reg.exec(args[0]);
if (match === null) {
- await res.stop(errorMsg('incorrect format, just an index or start-end format'));
+ await msg.channel.send(errorMsg('incorrect format, just an index or start-end format'));
return;
}
@@ -44,19 +40,19 @@ export default class implements Command {
const range = [parseInt(match[1], 10), parseInt(match[2], 10)];
if (range[0] < 1) {
- await res.stop(errorMsg('you start counting with 1'));
+ await msg.channel.send(errorMsg('you start counting with 1'));
return;
}
if (range[1] > player.queueSize()) {
- await res.stop(errorMsg('queue isn\'t THAT big'));
+ await msg.channel.send(errorMsg('queue isn\'t THAT big'));
return;
}
if (range[0] < range[1]) {
player.removeFromQueue(range[0], range[1] - range[0] + 1);
} else {
- await res.stop(errorMsg('range is backwards, just like you'));
+ await msg.channel.send(errorMsg('range is backwards, just like you'));
return;
}
@@ -65,18 +61,18 @@ export default class implements Command {
const index = parseInt(match[3], 10);
if (index < 1) {
- await res.stop(errorMsg('it\'s got be bigger than 0, chief'));
+ await msg.channel.send(errorMsg('it\'s got be bigger than 0, chief'));
return;
}
if (index > player.queueSize()) {
- await res.stop(errorMsg('queue isn\'t THAT big'));
+ await msg.channel.send(errorMsg('queue isn\'t THAT big'));
return;
}
player.removeFromQueue(index, 1);
}
- await res.stop('to the trash it goes :wastebasket:');
+ await msg.channel.send('to the trash it goes :wastebasket:');
}
}