Music-Discord-Bot icon indicating copy to clipboard operation
Music-Discord-Bot copied to clipboard

While using remove Command raised an exception: AttributeError: 'Bot' object has no attribute 'music'

Open shamspias opened this issue 2 years ago • 2 comments

Problem while trying to remove a song from the queue it shows that error the problem is in Cogs/removeRemoverange.py

if (int(index) - 1) > len(self.bot.music[ctx.guild.id]["musics"]): return await ctx.channel.send(f"{self.bot.emojiList.false} {ctx.author.mention} The index is invalid!")

Solve,

just comment out these 2 line no need for any use.

after commenting it out it will show another error,

Command raised an exception: IndexError: list index out of range

because track = tracks[index]

solve is

track = tracks[index-2]

shamspias avatar Oct 19 '21 13:10 shamspias

This line checks if the index is not upper that the last index of the queue. So it is useful

Darkempire78 avatar Oct 19 '21 14:10 Darkempire78

This line checks if the index is not upper that the last index of the queue. So it is useful

yes but self.bot.music this Bot' object has no attribute 'music'

shamspias avatar Oct 19 '21 14:10 shamspias