Skip to content

Commit

Permalink
bot: very small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosszzz authored Sep 18, 2024
1 parent e0e7cae commit 1a4fe99
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/commands/music/playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default {
})
}
});
interaction.client.queues.set(interaction.guild!.id as string, queue);
interaction.client.queues.set(interaction.guild!.id, queue);

await queue.enqueue({ songs: playlist.videos });
}
Expand All @@ -82,7 +82,7 @@ export default {
{
name: playlist.data instanceof SpotifyPlaylist || playlist.data instanceof SoundCloudPlaylist ? playlist.data.name : playlist.data.title!, value: "** **"
})
.setURL(playlist.data.url as string);
.setURL(playlist.data.url ?? null);

return await interaction.editReply({ embeds: [playlistEmbed] }).catch((err: Error) => Logger.error({ type: "MUSICCMDS", err }));
},
Expand Down
4 changes: 2 additions & 2 deletions src/commands/music/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
.setDescription("There is nothing playing in the queue currently.");
if (!queue || !queue.songs || !queue.songs.length) return await interaction.reply({ embeds: [nothingPlaying], ephemeral: true });

let currentPage: number = 0 as number;
let currentPage = 0;

const embeds = generateQueueEmbed(interaction, queue.songs);
const queueButtons = new ActionRowBuilder<ButtonBuilder>()
Expand Down Expand Up @@ -88,7 +88,7 @@ function generateQueueEmbed(interaction: ChatInputCommandInteraction<CacheType>,
.setAuthor({ name: "Track Queue" })
.setTitle(`Current Song - ${songs[0].title}`)
.setURL(songs[0].url)
.setThumbnail(interaction.guild!.iconURL() as string)
.setThumbnail(interaction.guild!.iconURL())
.setDescription(`**Displaying the queue list below:**\n\n${info}`)
.setFooter({ text: `${songs.length} tracks.` });

Expand Down
2 changes: 1 addition & 1 deletion src/commands/music/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
.setDescription("The volume level to set the music to.")
),
async execute(interaction) {
const queue = interaction.client.queues.get(interaction.guild!.id as string);
const queue = interaction.client.queues.get(interaction.guild!.id);
const volTarget = interaction.options.getNumber("level") as number;

const notInVC = new EmbedBuilder()
Expand Down
2 changes: 1 addition & 1 deletion src/components/MusicQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class MusicQueue {

if (this.player.state.status == AudioPlayerStatus.Playing || this.songs.length) return;

this.bot.queues.delete(this.interaction.guild!.id as string);
this.bot.queues.delete(this.interaction.guild!.id);
this.textChannel.send("Left channel due to inactivity.");
}, config.STAY_TIME * 1000);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Song.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class Song {
} else if (isSoundCloudUrl) {
const scSong = await soundcloud(search) as SoundCloudTrack;
return new this({
title: scSong.name as string,
title: scSong.name,
url: scSong.permalink,
duration: scSong.durationInSec,
durationRaw: undefined,
Expand Down

0 comments on commit 1a4fe99

Please sign in to comment.