Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com>
  • Loading branch information
TannerGabriel committed Feb 8, 2024
1 parent 72c133b commit 3c22e9c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ After cloning the project and installing all dependencies, you need to add your

You can change the status of your discord bot by editing the `activity` and `activityType` variables inside the `config.json` file. `activityType` needs to be set to an integer with the following [options](https://discord-api-types.dev/api/discord-api-types-v10/enum/ActivityType).

### Changing the default volume

The default volume can be adjusted by changing the volume variable inside the `config.json` file. If you only want to adjust the volume for a single song/playlist instead, use the volume command instead.

### Starting the application

Expand Down
2 changes: 1 addition & 1 deletion commands/volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = {
],
async execute(interaction) {
const {default: Conf} = await import('conf');
const inVoiceChannel = isInVoiceChannel(interaction);

await interaction.deferReply();

Expand All @@ -29,6 +28,7 @@ module.exports = {

// Set the volume of the current queue
const queue = useQueue(interaction.guild.id);
const inVoiceChannel = isInVoiceChannel(interaction);
if (inVoiceChannel && queue && queue.currentTrack) queue.node.setVolume(volume);

return void interaction.followUp({
Expand Down
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ client.on('interactionCreate', async interaction => {
try {
if (interaction.commandName == 'ban' || interaction.commandName == 'userinfo') {
command.execute(interaction, client);
} else if (interaction.commandName == 'volume' || interaction.commandName == 'play') {
command.execute(interaction);
// command.execute(interaction, config)
} else {
command.execute(interaction);
}
Expand Down

0 comments on commit 3c22e9c

Please sign in to comment.