galacticwarrior9 / IslamBot

A Discord bot that supports Qur'an, hadith, prayer times, tafsir and more.
GNU General Public License v3.0
89 stars 37 forks source link

Bot not notifying user when requested ayah number is too high #52

Closed msabur closed 2 years ago

msabur commented 2 years ago

The bot doesn't notify the user when the requested ayah number is more than the number of ayahs in the surah. An example is -quran 12:400. The surah has less than 400 ayahs.

msabur commented 2 years ago

There is an invalid ayah message in quran.py, but it doesn't seem to be sending. https://github.com/galacticwarrior9/IslamBot/blob/master/quran/quran.py#L25

itzmk21 commented 2 years ago

I remember that working before. I think the whole reveal surah argument commit broke it.

msabur commented 2 years ago

It was fixed for me after removing the InvalidAyah class in quran.py. Apparently, that was shadowing the identically-named class in quran_info.py. As a result, when the InvalidAyah exception was thrown, the isInstance call was comparing to the wrong class.