forked from EllieBotDevs/elliebot
Updated Searches module
This commit is contained in:
parent
f91771a8db
commit
0787490aea
3 changed files with 103 additions and 29 deletions
src/EllieBot/Modules/Searches
|
@ -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)
|
||||
{
|
||||
|
|
Reference in a new issue