Skip to content

Commit 1a4fe99

Browse files
authored
bot: very small cleanup
1 parent e0e7cae commit 1a4fe99

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/commands/music/playlist.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default {
7070
})
7171
}
7272
});
73-
interaction.client.queues.set(interaction.guild!.id as string, queue);
73+
interaction.client.queues.set(interaction.guild!.id, queue);
7474

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

8787
return await interaction.editReply({ embeds: [playlistEmbed] }).catch((err: Error) => Logger.error({ type: "MUSICCMDS", err }));
8888
},

src/commands/music/queue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default {
1616
.setDescription("There is nothing playing in the queue currently.");
1717
if (!queue || !queue.songs || !queue.songs.length) return await interaction.reply({ embeds: [nothingPlaying], ephemeral: true });
1818

19-
let currentPage: number = 0 as number;
19+
let currentPage = 0;
2020

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

src/commands/music/volume.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default {
1212
.setDescription("The volume level to set the music to.")
1313
),
1414
async execute(interaction) {
15-
const queue = interaction.client.queues.get(interaction.guild!.id as string);
15+
const queue = interaction.client.queues.get(interaction.guild!.id);
1616
const volTarget = interaction.options.getNumber("level") as number;
1717

1818
const notInVC = new EmbedBuilder()

src/components/MusicQueue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class MusicQueue {
142142

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

145-
this.bot.queues.delete(this.interaction.guild!.id as string);
145+
this.bot.queues.delete(this.interaction.guild!.id);
146146
this.textChannel.send("Left channel due to inactivity.");
147147
}, config.STAY_TIME * 1000);
148148
}

src/components/Song.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class Song {
5252
} else if (isSoundCloudUrl) {
5353
const scSong = await soundcloud(search) as SoundCloudTrack;
5454
return new this({
55-
title: scSong.name as string,
55+
title: scSong.name,
5656
url: scSong.permalink,
5757
duration: scSong.durationInSec,
5858
durationRaw: undefined,

0 commit comments

Comments
 (0)