mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Removed .novel command as it no longer works
This commit is contained in:
@@ -16,33 +16,33 @@ namespace NadekoBot.Modules.Searches
|
||||
[Group]
|
||||
public class AnimeSearchCommands : NadekoSubmodule<AnimeSearchService>
|
||||
{
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task Novel([Leftover] string query)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(query))
|
||||
return;
|
||||
|
||||
var novelData = await _service.GetNovelData(query).ConfigureAwait(false);
|
||||
|
||||
if (novelData is null)
|
||||
{
|
||||
await ReplyErrorLocalizedAsync(strs.failed_finding_novel).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
var embed = _eb.Create()
|
||||
.WithOkColor()
|
||||
.WithDescription(novelData.Description.Replace("<br>", Environment.NewLine, StringComparison.InvariantCulture))
|
||||
.WithTitle(novelData.Title)
|
||||
.WithUrl(novelData.Link)
|
||||
.WithImageUrl(novelData.ImageUrl)
|
||||
.AddField(GetText(strs.authors), string.Join("\n", novelData.Authors), true)
|
||||
.AddField(GetText(strs.status), novelData.Status, true)
|
||||
.AddField(GetText(strs.genres), string.Join(" ", novelData.Genres.Any() ? novelData.Genres : new[] { "none" }), true)
|
||||
.WithFooter($"{GetText(strs.score)} {novelData.Score}");
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||
}
|
||||
// [NadekoCommand, Aliases]
|
||||
// public async Task Novel([Leftover] string query)
|
||||
// {
|
||||
// if (string.IsNullOrWhiteSpace(query))
|
||||
// return;
|
||||
//
|
||||
// var novelData = await _service.GetNovelData(query).ConfigureAwait(false);
|
||||
//
|
||||
// if (novelData is null)
|
||||
// {
|
||||
// await ReplyErrorLocalizedAsync(strs.failed_finding_novel).ConfigureAwait(false);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// var embed = _eb.Create()
|
||||
// .WithOkColor()
|
||||
// .WithDescription(novelData.Description.Replace("<br>", Environment.NewLine, StringComparison.InvariantCulture))
|
||||
// .WithTitle(novelData.Title)
|
||||
// .WithUrl(novelData.Link)
|
||||
// .WithImageUrl(novelData.ImageUrl)
|
||||
// .AddField(GetText(strs.authors), string.Join("\n", novelData.Authors), true)
|
||||
// .AddField(GetText(strs.status), novelData.Status, true)
|
||||
// .AddField(GetText(strs.genres), string.Join(" ", novelData.Genres.Any() ? novelData.Genres : new[] { "none" }), true)
|
||||
// .WithFooter($"{GetText(strs.score)} {novelData.Score}");
|
||||
//
|
||||
// await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||
// }
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
[Priority(0)]
|
||||
|
@@ -59,7 +59,10 @@ namespace NadekoBot.Modules.Searches.Services
|
||||
query = query.Replace(" ", "-", StringComparison.InvariantCulture);
|
||||
try
|
||||
{
|
||||
var link = "http://www.novelupdates.com/series/" + Uri.EscapeDataString(query.Replace("/", " ", StringComparison.InvariantCulture));
|
||||
var link = "https://www.novelupdates.com/series/" + Uri.EscapeDataString(query
|
||||
.Replace(" ", "-")
|
||||
.Replace("/", " ")
|
||||
);
|
||||
link = link.ToLowerInvariant();
|
||||
var (ok, data) = await _cache.TryGetNovelDataAsync(link).ConfigureAwait(false);
|
||||
if (!ok)
|
||||
|
@@ -1181,8 +1181,6 @@ timely:
|
||||
- timely
|
||||
timelyreset:
|
||||
- timelyreset
|
||||
novel:
|
||||
- novel
|
||||
crypto:
|
||||
- crypto
|
||||
- c
|
||||
|
@@ -1973,10 +1973,6 @@ timelyreset:
|
||||
desc: "Resets all user timeouts on `{0}timely` command."
|
||||
args:
|
||||
- ""
|
||||
novel:
|
||||
desc: "Searches for a novel on `http://novelupdates.com/`. You have to provide an exact name."
|
||||
args:
|
||||
- "the nine cauldrons"
|
||||
crypto:
|
||||
desc: "Shows basic stats about a cryptocurrency from coinmarketcap.com. You can use either a name or an abbreviation of the currency."
|
||||
args:
|
||||
|
Reference in New Issue
Block a user