Skip to content

Commit

Permalink
fix: fetch voice channel before read members
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilhermeasper committed Aug 27, 2023
1 parent e87d6ec commit 7894358
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/services/tempo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ export class TempoDataProvider {
async getPlaybackDataFromMessage(message: Message): Promise<PlaybackData> {
const title = message?.embeds[0]?.title?.slice(this.titlePaddingIndex);

const voiceChannelId = message.member.voice.channelId;
const voiceChannel = (await message.guild.channels.fetch(
voiceChannelId
)) as BaseGuildVoiceChannel;
const voiceChannel =
(await message.member.voice.channel.fetch()) as BaseGuildVoiceChannel;
const listeningUsersId = voiceChannel.members.map((member) => member.id);

return {
Expand Down

0 comments on commit 7894358

Please sign in to comment.