mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 22:16:13 +00:00
fix: Changed command logic to be in property execute instead of run
This commit is contained in:
1 parent
6fdd943e56
commit
2d0df79dac
15 files changed
+18
-15
No files matched your search
@@ -8,7 +8,7 @@ module.exports = {
|
||||
.setName('help')
|
||||
.setDescription('Show a list of commands and their usage.')
|
||||
.setDMPermission(false),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = {
|
||||
.setName('filters')
|
||||
.setDescription('Toggle various audio filters during playback.')
|
||||
.setDMPermission(false),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = {
|
||||
.setDMPermission(false),
|
||||
|
||||
// todo, allow command to be executed if bot is only member in voice channel
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -21,7 +21,7 @@ module.exports = {
|
||||
{ name: 'Disabled', value: '0' }
|
||||
)
|
||||
),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = {
|
||||
.setName('nowplaying')
|
||||
.setDescription('Show information about the track currently playing.')
|
||||
.setDMPermission(false),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = {
|
||||
.setName('pause')
|
||||
.setDescription('Pause or resume the current track.')
|
||||
.setDMPermission(false),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = {
|
||||
.setDescription('Add a track or playlist to the queue by searching or url.')
|
||||
.setDMPermission(false)
|
||||
.addStringOption((option) => option.setName('query').setDescription('Search query or URL.').setRequired(true)),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = {
|
||||
.setDescription('Show the list of tracks added to the queue.')
|
||||
.setDMPermission(false)
|
||||
.addNumberOption((option) => option.setName('page').setDescription('Page number of the queue').setMinValue(1)),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = {
|
||||
.setMinValue(1)
|
||||
.setRequired(true)
|
||||
),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = {
|
||||
.setDescription('Duration in format 00:00:00 (HH:mm:ss) to seek to.')
|
||||
.setRequired(true)
|
||||
),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = {
|
||||
.addNumberOption((option) =>
|
||||
option.setName('tracknumber').setDescription('Track number to skip to in the queue.').setMinValue(1)
|
||||
),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = {
|
||||
.setMinValue(0)
|
||||
.setMaxValue(100)
|
||||
),
|
||||
run: async ({ interaction }) => {
|
||||
execute: async ({ interaction }) => {
|
||||
if (!interaction.member.voice.channel) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = {
|
||||
.setName('guilds')
|
||||
.setDescription('Show list of guilds where bot is added.')
|
||||
.setDMPermission(false),
|
||||
run: async ({ interaction, client }) => {
|
||||
execute: async ({ interaction, client }) => {
|
||||
if (!systemServerGuildIds.includes(interaction.guildId)) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -9,7 +9,7 @@ const packageJson = require(path.resolve('./package.json'));
|
||||
module.exports = {
|
||||
isSystemCommand: true,
|
||||
data: new SlashCommandBuilder().setName('status').setDescription('Show bot status.').setDMPermission(false),
|
||||
run: async ({ interaction, client }) => {
|
||||
execute: async ({ interaction, client }) => {
|
||||
if (!systemServerGuildIds.includes(interaction.guildId)) {
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -13,13 +13,16 @@ module.exports = {
|
||||
|
||||
const command = client.commands.get(interaction.commandName);
|
||||
if (!command) {
|
||||
logger.warn(`Interaction created but command '${interaction.commandName}' was not found.`);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const inputTime = new Date();
|
||||
|
||||
await interaction.deferReply();
|
||||
await command.run({ interaction, client });
|
||||
await command.execute({ interaction, client });
|
||||
|
||||
const outputTime = new Date();
|
||||
const executionTime = outputTime - inputTime;
|
||||
|
||||
|
||||
Reference in new issue
Block a user