Support for embeds in .qsearch output

- Support for embeds in .qsearch output results
- Search can be case insensitive (changes made 011b951a29)
- Output shows keyword in lowercase as it's easier to read (line 104)
- Minor syntax cleanups
This commit is contained in:
Shikhir Arora 2017-03-02 03:41:33 -05:00 committed by GitHub
parent 011b951a29
commit 9344c1b498

View File

@ -90,7 +90,18 @@ namespace NadekoBot.Modules.Utility
if (keywordquote == null)
return;
await Context.Channel.SendMessageAsync("💬 " + keyword + ": " + keywordquote.Text.SanitizeMentions());
CREmbed crembed;
if (CREmbed.TryParse(keywordquote.Text, out crembed))
{
try { await Context.Channel.EmbedAsync(crembed.ToEmbed(), crembed.PlainText ?? "").ConfigureAwait(false); }
catch (Exception ex)
{
_log.Warn("Sending CREmbed failed");
_log.Warn(ex);
}
return;
}
await Context.Channel.SendMessageAsync("💬 " + keyword.toLowerInvariant(); + ": " + keywordquote.Text.SanitizeMentions());
}
[NadekoCommand, Usage, Description, Aliases]