galacticwarrior9 / islambot Goto Github PK
View Code? Open in Web Editor NEWA Discord bot that supports Qur'an, hadith, prayer times, tafsir and more.
License: GNU General Public License v3.0
A Discord bot that supports Qur'an, hadith, prayer times, tafsir and more.
License: GNU General Public License v3.0
Similar to Get Hadith Text
context menu or the on_message
listener for sunnah.com links
When I use the command -hadith nawawi 1
, the bot says that the hadith can't be found. I looked into it a bit, and it seems that the API was giving a 404 response. A possible solution is using "forty" instead of "nawawi40" as the collection name when making the request. That solved the error for me.
https://api.sunnah.com/v1/collections/nawawi40/hadiths/1
returned 404
https://api.sunnah.com/v1/collections/forty/hadiths/1
gave the hadith
May Allah reward you for your amazing work
Context menu commands do not require guild message content intent.
Esselamu aleykum we rahmetullahi we berekatuh brothers!
Today I have notices that Dutch -> M. F. Abdul Islam is added, could you add that also here?
Thank you in advance.
We aleykum esselam we rahmetullahi we berekatuh
The bot currently has about 114 translations if I remember correctly, whereas Quran.com API offer about 141 (iirc).
Some translations such as suhel
aren't offered by the API anymore too.
The bot could either fetch the API translations list every time a user requests it which would be veryyy resourceful, or simply update it once in a while such as now.
Although hard coding the list once in a while isn't very elegant unfortunately.
Esselamu alaikum wa rahmatullahi wa barakatuh brother,
Is it possible to remove "grade : Sahih" when we quote Hadith from Sahih al-Bukhari and Sahih Muslim?
Many brother think now that the hadith in these two books needs also be graded, and so they assume that there are many da'if ahadith also in it. (thus it needs a grade).
Since the original website (sunnah.com) has no grade for it, and they explained it here (https://sunnah.com/about) why they made the choice, it would be nice to coherent with them, in shaa Allah.
Thanks in advance!
Using application commands will reduce total resource use by not scanning all the messages.
/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
.
Just like when searching for a Hadith book, it will say fully "Sahih ul Bukhari" instead of the abbreviation, similarly, Quran translations should do the same. For example right now it displays "sahih" but it should be displayed as "Sahih International".
Would love to read and send verses to discord channels from Edip Yuksel's translation... Can you add this translation too? God bless you.
All hadiths like this https://sunnah.com/muslim:8c won't be excuted by the bot
The bot could add more duas to its list.
I am making an Islamic bot for my server and I need access to the Sunnah.com API.
api.quran.com returns the same json after each request
Instead of sending a request to the api, instead use the random module to generate a random surah, and verse
Steps to reproduce:
Probably website it scrapes off is structured differently now?
On tafsir and possibly hadith too
Although hadith is hard since users can input bukhari 1 or 1:1
Similar to how /morphology already does it
It looks like the set translation command is not getting picked up by the bot. Had a few people try for me and none of us were able to use the syntax and get any result: -settranslation sahih
Something like /settafsir tafsir:
...since subcommands will eventually be nested under their parent command on the UI...
Possible proposal:
Redoing the command groups such as making it so /quran
will be a group and there would be /quran translated
, /quran arabic
, /quran translated random
, /quran arabic random
, and possibly /quran morphology
being subcommands.
Nice because:
-Neat, easy to find and discover through the UI
However:
-Messy such as with /quran translated random
lol
Or a bit more leniently, /quran
and /aquran
being separate groups and having /quran (idk)
and /quran random
being subcommands.
Or /random
being a group and having /random quran
, /random mushaf
, /random dua
be subcommands.
Also having /set
being a group and /set translation
, /set default_tafsir
etc if that #61 goes ahead.
Having buttons under a Hadith embed to navigate to the next hadith in the current collection or under a Quran embed to navigate to the next ayah in the current surah would be beneficial for the exact reason page navigation exists for the Mushaf command. Users will be able to simply read through the translation of the Quran (or Tafsir or Ahaadith in a collection) for the entire surah (or hadith collection) in one go without having to always type in the surah name then next ayah number (or hadith number) they desire.
Sometimes embeds require page navigators - these proposed navigators would be underneath them.
Would need to consider the limit of the number of ayahs in a surah or number of hadith in a collection. Also need to consider when a user does the Quran command with multiple ayahs in the embed - pressing "Next Ayah" or maybe "Next Ayahs" in that scenario would have to account for how many ayahs were in the original embed.
On running /dua topic: Pain
, the output is missing numbers in parenthesis. Instead of saying (3 times)
and (7 times)
, it just says ( times)
.
It displays correctly in the website that the bot takes from: https://ahadith.co.uk/hisnulmuslim-dua-117
Jazak Allah khairan
/biography name: عبد الله بن عباس
gives this error:
Traceback (most recent call last):
File "/home/mk/Documents/Files/Projects/Discord Bots/IslamBot/venv/lib/python3.10/site-packages/discord/app_commands/commands.py", line 850, in _do_call
return await self._callback(self.binding, interaction, **params) # type: ignore
File "/home/mk/Documents/Files/Projects/Discord Bots/IslamBot/hadith/transmitter_biographies.py", line 52, in biography
await self._biography(interaction, name)
File "/home/mk/Documents/Files/Projects/Discord Bots/IslamBot/hadith/transmitter_biographies.py", line 19, in _biography
soup = await get_site_source(BIOGRAPHY_URL.format(name))
File "/home/mk/Documents/Files/Projects/Discord Bots/IslamBot/utils/utils.py", line 90, in get_site_source
text = await resp.read()
File "/home/mk/Documents/Files/Projects/Discord Bots/IslamBot/venv/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1036, in read
self._body = await self.content.read()
File "/home/mk/Documents/Files/Projects/Discord Bots/IslamBot/venv/lib/python3.10/site-packages/aiohttp/streams.py", line 375, in read
block = await self.readany()
File "/home/mk/Documents/Files/Projects/Discord Bots/IslamBot/venv/lib/python3.10/site-packages/aiohttp/streams.py", line 397, in readany
await self._wait("readany")
File "/home/mk/Documents/Files/Projects/Discord Bots/IslamBot/venv/lib/python3.10/site-packages/aiohttp/streams.py", line 304, in _wait
await waiter
aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed
The ClientPayloadError
is raised from this line text = await resp.read()
.
I suspect this has to do with the actual website
/biography name: آدم بن سليمان مولى خالد بن خالد
works perfectly though.
This would take advantage of the ephemeral ability and clean up the channel by having no error messages
Just standardises the formatting as well as not triggering any IDE.
Hi, is the bot stop working 15mn 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.
Is it possible to add the english version of Tafsir Al Saadi, I have a pdf where u can copy paste but will have to clean up the paste. I can try to help if you want.
[https://www.kalamullah.com/tafseer-as-sadi.html](Tafsir Al saadi pdfs)
E.g: -hadith muslim 1000a will not work
A function that will allow the user to use a command like -set
and set the channel the message is in and time they sent the message to have the bot send an ayah/hadith there daily.
The bot does not respond to posted links such as https://sunnah.com/bukhari:1
with the "book:number" reference style.
The bot is used on several servers where the primary language is neither English or Arabic.
The usage of user-contributed translations will increase the accessibility of the bot to more communities.
Would love to have the ability to generate a random verse/ayah.
With the efc0f48 / 2b8778c commits, the /quran
command was updated with the description:
"The name or number of the surah to fetch, e.g. Al-Ikhlaas, 112 or إخلاص"
The /mushaf
, /tafsir
, /morphology
, and /surah
commands are still to be updated - these commands can still reference a Surah by the Arabic. Also, each description uses Surah Al-Ikhlaas as an example except for the /surah
command that uses Surah Al-Baqarah as an example. Perhaps for consistency, having the /surah
description also being Surah Al-Ikhlaas could be better.
After all, it is known that this bot will not be granted access to text chats.
It's the best english quran translation. Can you please add it to the list.
Peace be upon you.
The current system floods the al-adhan API with thousands of requests a day. This is slow and will break if the API goes offline.
Some ideas:
Can it be included in the list of English translations? I'm not sure how the translations are selected, and which ones are ok to include. If it is a matter of time and effort, I could perhaps help in some way?
Salaam Alaykum,
May Allah reward you. A few weeks ago the bot stopped posting translations and Quraan. It just shows "is typing" for a few seconds and then stops.
What should we do you think?
Ali
E.g <a class='sup'>
.... Your...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.