Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Ayah from URL and /tafsir set and /atafsir set commands #61

Merged
merged 21 commits into from
Sep 8, 2022

Conversation

itzmk21
Copy link
Contributor

@itzmk21 itzmk21 commented Sep 5, 2022

Added the context menu command that gets the Qur'an ayah from a URL
This was tested with the following links, all of which work as intended:

[
            'https://quran.com/'
            'https://quran.com/',

            'https://quran.com/12:5',
            'https://quran.com/10:19/',
            'https://quran.com/7:12?param=value',
            'https://quran.com/154:3?param=value/',
            'https://quran.com/22:1-5/?param=value',
            'https://quran.com/11:45-542/?param=value/',

            'https://quran.com/12/5',
            'https://quran.com/10/19/',
            'https://quran.com/7/12?param=value',
            'https://quran.com/154/3?param=value/',
            'https://quran.com/22/1-5/?param=value',
            'https://quran.com/11/45-542/?param=value',
        ]

Closes #40

Rewrote the DBHandler child classes for less repetition
Made tafsir commands into a group:

  • /tafsir get ... /tafsir set_default_tafsir - not a flattering name, but up to you
  • /atafsir get ... /atafsir set_default_atafsir

This requires you to create new tables:
For Tafsir columns:

  • server which is the guild_id so up to you what datatype
  • tafsir which is the tafsir_name similar to the translation name similarly stored, so a string-based datatype e.g "maarifulquran" will be stored
    For Arabic Tafsir columns:
  • server - the guild_id
  • atafsir (could change the name), e.g: "tabari" will be stored

Closes #55

Use the app_commands.Range annotation to have built in range check, that checks if the page is between 1 and 604 for /mushaf by_page as well as for the day month and year args for /calendar commands

Update the help command embed to make mention slash commands - closes #62

@galacticwarrior9 galacticwarrior9 merged commit 0dc8675 into galacticwarrior9:master Sep 8, 2022
@itzmk21 itzmk21 deleted the tafsirdb branch September 10, 2022 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants