-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds logger, to be able to log debug mode some function calls
- Loading branch information
1 parent
efac7c1
commit 923f233
Showing
12 changed files
with
122 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const { GuildMember } = require('discord.js') | ||
const Logger = require('../../logger/Logger') | ||
|
||
module.exports = { | ||
name: 'skip', | ||
description: 'Skip the current track', | ||
emoji: '⏭️', | ||
async execute(interaction, player) { | ||
try { | ||
if ( | ||
!(interaction.member instanceof GuildMember) || | ||
!interaction.member.voice.channel | ||
) { | ||
return void interaction.reply({ | ||
content: 'You are not in a voice channel!', | ||
ephemeral: true, | ||
}) | ||
} | ||
|
||
if ( | ||
interaction.guild.me.voice.channelId && | ||
interaction.member.voice.channelId !== | ||
interaction.guild.me.voice.channelId | ||
) { | ||
return void interaction.reply({ | ||
content: 'You are not in my voice channel!', | ||
ephemeral: true, | ||
}) | ||
} | ||
|
||
await interaction.deferReply() | ||
const queue = player.getQueue(interaction.guildId) | ||
if (!queue || !queue.playing) { | ||
return void interaction.followUp({ | ||
content: "❌ There's no track being played", | ||
}) | ||
} | ||
const skipped = queue.skip() | ||
return void interaction.followUp({ | ||
content: skipped | ||
? `⏭️ | Skipped current track` | ||
: `❌ | Coulnd't skip this track!`, | ||
}) | ||
} catch (error) { | ||
Logger.log(error) | ||
interaction.followUp({ | ||
content: `There was an error trying to skip your track: ${error.message}`, | ||
}) | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.