Updated Searches module

This commit is contained in:
Toastie 2024-07-07 22:28:56 +12:00
parent f91771a8db
commit 0787490aea
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
3 changed files with 103 additions and 29 deletions
src/EllieBot/Modules/Searches

View file

@ -528,34 +528,6 @@ public partial class Searches : EllieModule<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)
{