Small wording tweaks to the !anime and !manga commands. They also no long need their description html decoded.

This commit is contained in:
runebaas 2020-09-24 18:29:21 +02:00
parent ed7748833a
commit 41795aa13f
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -2,7 +2,6 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using Discord;
using Discord.Commands;
using Geekbot.Core;
@ -32,22 +31,19 @@ namespace Geekbot.Bot.Commands.Integrations
var anime = results.Results.FirstOrDefault();
if (anime != null)
{
var eb = new EmbedBuilder();
var eb = new EmbedBuilder
{
Title = anime.Title,
Description = anime.Description,
ImageUrl = anime.ImageURL
};
var description = HttpUtility.HtmlDecode(anime.Description)
.Replace("<br />", "")
.Replace("[i]", "*")
.Replace("[/i]", "*");
eb.Title = anime.Title;
eb.Description = description;
eb.ImageUrl = anime.ImageURL;
eb.AddInlineField("Premiered", FormatDate(anime.StartDate));
eb.AddInlineField("Ended", anime.Airing ? "Present" : FormatDate(anime.EndDate));
eb.AddInlineField("Episodes", anime.Episodes);
eb.AddInlineField("MAL Score", anime.Score);
eb.AddInlineField("Type", anime.Type);
eb.AddField("MAL Link", $"https://myanimelist.net/anime/{anime.MalId}");
eb.AddInlineField("Premiere", FormatDate(anime.StartDate))
.AddInlineField("Ended", anime.Airing ? "-" : FormatDate(anime.EndDate))
.AddInlineField("Episodes", anime.Episodes)
.AddInlineField("MAL Score", anime.Score)
.AddInlineField("Type", anime.Type)
.AddField("MAL Link", $"https://myanimelist.net/anime/{anime.MalId}");
await ReplyAsync("", false, eb.Build());
}
@ -72,22 +68,19 @@ namespace Geekbot.Bot.Commands.Integrations
var manga = results.Results.FirstOrDefault();
if (manga != null)
{
var eb = new EmbedBuilder();
var eb = new EmbedBuilder
{
Title = manga.Title,
Description = manga.Description,
ImageUrl = manga.ImageURL
};
var description = HttpUtility.HtmlDecode(manga.Description)
.Replace("<br />", "")
.Replace("[i]", "*")
.Replace("[/i]", "*");
eb.Title = manga.Title;
eb.Description = description;
eb.ImageUrl = manga.ImageURL;
eb.AddInlineField("Premiered", FormatDate(manga.StartDate));
eb.AddInlineField("Ended", manga.Publishing ? "Present" : FormatDate(manga.EndDate));
eb.AddInlineField("Volumes", manga.Volumes);
eb.AddInlineField("Chapters", manga.Chapters);
eb.AddInlineField("MAL Score", manga.Score);
eb.AddField("MAL Link", $"https://myanimelist.net/manga/{manga.MalId}");
eb.AddInlineField("Premiere", FormatDate(manga.StartDate))
.AddInlineField("Ended", manga.Publishing ? "-" : FormatDate(manga.EndDate))
.AddInlineField("Volumes", manga.Volumes)
.AddInlineField("Chapters", manga.Chapters)
.AddInlineField("MAL Score", manga.Score)
.AddField("MAL Link", $"https://myanimelist.net/manga/{manga.MalId}");
await ReplyAsync("", false, eb.Build());
}