Revert "ephemeraledit play command"

This commit is contained in:
Corwin 2023-12-21 11:59:56 +01:00 committed by GitHub
parent 6080034ef3
commit d314e73b2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,20 +3,20 @@ const Discord = require('discord.js');
module.exports = async (client, interaction, args) => { module.exports = async (client, interaction, args) => {
if (!interaction.member.voice.channel) return client.errNormal({ if (!interaction.member.voice.channel) return client.errNormal({
error: `You're not in a voice channel!`, error: `You're not in a voice channel!`,
type: 'ephemeraledit' type: 'editreply'
}, interaction); }, interaction);
let channel = interaction.member.voice ? interaction.member.voice.channel : null; let channel = interaction.member.voice ? interaction.member.voice.channel : null;
if (!channel) return client.errNormal({ if (!channel) return client.errNormal({
error: `The channel does not exist!`, error: `The channel does not exist!`,
type: 'ephemeraledit' type: 'editreply'
}, interaction); }, interaction);
let player = client.player.players.get(interaction.guild.id); let player = client.player.players.get(interaction.guild.id);
if (player && (channel.id !== player?.voiceChannel)) return client.errNormal({ if (player && (channel.id !== player?.voiceChannel)) return client.errNormal({
error: `You are not in the same voice channel!`, error: `You are not in the same voice channel!`,
type: 'ephemeraledit' type: 'editreply'
}, interaction); }, interaction);
if (!player) { if (!player) {
@ -29,7 +29,7 @@ module.exports = async (client, interaction, args) => {
if (!channel.joinable) return client.errNormal({ if (!channel.joinable) return client.errNormal({
error: `That channel isn\'t joinable`, error: `That channel isn\'t joinable`,
type: 'ephemeraledit' type: 'editreply'
}, interaction); }, interaction);
player.connect() player.connect()
@ -47,7 +47,7 @@ module.exports = async (client, interaction, args) => {
client.simpleEmbed({ client.simpleEmbed({
desc: `🔎┆Searching...`, desc: `🔎┆Searching...`,
type: 'ephemeraledit' type: 'editreply'
}, interaction) }, interaction)
const res = await player.search(query, interaction.user); const res = await player.search(query, interaction.user);
@ -56,7 +56,7 @@ module.exports = async (client, interaction, args) => {
if (!player.queue.current) player.destroy(); if (!player.queue.current) player.destroy();
return client.errNormal({ return client.errNormal({
error: `Error getting music. Please try again in a few minutes`, error: `Error getting music. Please try again in a few minutes`,
type: 'ephemeraledit' type: 'editreply'
}, interaction); }, interaction);
} }
@ -65,7 +65,7 @@ module.exports = async (client, interaction, args) => {
if (!player.queue.current) player.destroy() if (!player.queue.current) player.destroy()
await client.errNormal({ await client.errNormal({
error: `No music was found`, error: `No music was found`,
type: 'ephemeraledit' type: 'editreply'
}, interaction); }, interaction);
break; break;
} }
@ -172,7 +172,7 @@ module.exports = async (client, interaction, args) => {
} }
], ],
components: [row, row2], components: [row, row2],
type: 'ephemeraledit' type: 'editreply'
}, interaction) }, interaction)
try { try {
@ -183,7 +183,7 @@ module.exports = async (client, interaction, args) => {
row2.components.forEach((button) => button.setDisabled(true)); row2.components.forEach((button) => button.setDisabled(true));
return client.errNormal({ return client.errNormal({
error: `You didn't provide a selection`, error: `You didn't provide a selection`,
type: 'ephemeraledit', type: 'editreply',
components: [row, row2] components: [row, row2]
}, interaction) }, interaction)
} }
@ -200,7 +200,7 @@ module.exports = async (client, interaction, args) => {
const index = Number(first) - 1; const index = Number(first) - 1;
if (index < 0 || index > max - 1) return client.errNormal({ if (index < 0 || index > max - 1) return client.errNormal({
error: `The number you provided too small or too big (1-${max})`, error: `The number you provided too small or too big (1-${max})`,
type: 'ephemeraledit' type: 'editreply'
}, interaction) }, interaction)
const track = res.tracks[index]; const track = res.tracks[index];