add: Added .quran command, which will show the provided ayah in english and arabic, including recitation by Alafasy

This commit is contained in:
Kwoth
2024-06-29 07:14:13 +00:00
parent 6f444a8da0
commit 5498c5ce3f
4 changed files with 114 additions and 28 deletions

View File

@@ -528,34 +528,6 @@ public partial class Searches : NadekoModule<SearchesService>
}
}
[Cmd]
[RequireContext(ContextType.Guild)]
public async Task Bible(string book, string chapterAndVerse)
{
var obj = new BibleVerses();
try
{
using var http = _httpFactory.CreateClient();
obj = await http.GetFromJsonAsync<BibleVerses>($"https://bible-api.com/{book} {chapterAndVerse}");
}
catch
{
}
if (obj.Error is not null || obj.Verses is null || obj.Verses.Length == 0)
await Response().Error(obj.Error ?? "No verse found.").SendAsync();
else
{
var v = obj.Verses[0];
await Response()
.Embed(_sender.CreateEmbed()
.WithOkColor()
.WithTitle($"{v.BookName} {v.Chapter}:{v.Verse}")
.WithDescription(v.Text))
.SendAsync();
}
}
[Cmd]
public async Task Steam([Leftover] string query)
{