aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2021-12-15 13:46:03 -0500
committerMax Isom <[email protected]>2021-12-15 13:46:03 -0500
commite965c023582b7f0699c37015ce79049db2be55f4 (patch)
tree5164470ee5c94b1da9d4d695fb2a1b679136e168
parentcbc9aafe780805d6aa3fb456fdb1620dc66679d3 (diff)
downloadmuse-e965c023582b7f0699c37015ce79049db2be55f4.tar.xz
muse-e965c023582b7f0699c37015ce79049db2be55f4.zip
Migrate pause command
-rw-r--r--src/commands/pause.ts22
-rw-r--r--src/commands/play.ts2
2 files changed, 13 insertions, 11 deletions
diff --git a/src/commands/pause.ts b/src/commands/pause.ts
index 1dee95d..c3e8c24 100644
--- a/src/commands/pause.ts
+++ b/src/commands/pause.ts
@@ -1,4 +1,5 @@
-import {Message} from 'discord.js';
+import {CommandInteraction} from 'discord.js';
+import {SlashCommandBuilder} from '@discordjs/builders';
import {TYPES} from '../types.js';
import {inject, injectable} from 'inversify';
import PlayerManager from '../managers/player.js';
@@ -8,11 +9,9 @@ import Command from '.';
@injectable()
export default class implements Command {
- public name = 'pause';
- public aliases = [];
- public examples = [
- ['pause', 'pauses currently playing song'],
- ];
+ public readonly slashCommand = new SlashCommandBuilder()
+ .setName('pause')
+ .setDescription('pauses the current song');
public requiresVC = true;
@@ -22,15 +21,18 @@ export default class implements Command {
this.playerManager = playerManager;
}
- public async execute(msg: Message, _: string []): Promise<void> {
- const player = this.playerManager.get(msg.guild!.id);
+ public async executeFromInteraction(interaction: CommandInteraction) {
+ const player = this.playerManager.get(interaction.guild!.id);
if (player.status !== STATUS.PLAYING) {
- await msg.channel.send(errorMsg('not currently playing'));
+ await interaction.reply({
+ content: errorMsg('not currently playing'),
+ ephemeral: true,
+ });
return;
}
player.pause();
- await msg.channel.send('the stop-and-go light is now red');
+ await interaction.reply('the stop-and-go light is now red');
}
}
diff --git a/src/commands/play.ts b/src/commands/play.ts
index 8e1616b..6e76e37 100644
--- a/src/commands/play.ts
+++ b/src/commands/play.ts
@@ -15,7 +15,7 @@ import GetSongs from '../services/get-songs.js';
export default class implements Command {
public readonly slashCommand = new SlashCommandBuilder()
.setName('play')
- .setDescription('Play a song or resume playback')
+ .setDescription('play a song or resume playback')
.addStringOption(option => option
.setName('query')
.setDescription('YouTube URL, Spotify URL, or search query'))