galacticwarrior9 / IslamBot

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

Bug: /prayertimes get #58

Closed itzmk21 closed 1 year ago

itzmk21 commented 1 year ago

/prayertimes get location: (any) would not work if a user /prayertimes set_calculation_method. This is possibly because the database prayer times handler returns the datatype that is the calculation_method column datatype in the table (which is possibly a string data type). This raises an exception because when setting the footer of the embed, the calculation_method is used as the key to the dict[int, str]

em.set_footer(text=f'Calculation Method: {self.calculation_methods[calculation_method]}')
     KeyError: '5'

'5' is an str while the keys in the calculation_methods dict are all int That's if the table column wasn't already an INTEGER.