../... now support embeds too
This commit is contained in:
parent
eeb9ff9370
commit
d5987f3331
@ -8,13 +8,14 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using NadekoBot.DataStructures;
|
||||||
|
|
||||||
namespace NadekoBot.Modules.Utility
|
namespace NadekoBot.Modules.Utility
|
||||||
{
|
{
|
||||||
public partial class Utility
|
public partial class Utility
|
||||||
{
|
{
|
||||||
[Group]
|
[Group]
|
||||||
public class QuoteCommands : ModuleBase
|
public class QuoteCommands : NadekoSubmodule
|
||||||
{
|
{
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
@ -56,6 +57,17 @@ namespace NadekoBot.Modules.Utility
|
|||||||
if (quote == null)
|
if (quote == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
CREmbed crembed;
|
||||||
|
if (CREmbed.TryParse(quote.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("📣 " + quote.Text.SanitizeMentions());
|
await Context.Channel.SendMessageAsync("📣 " + quote.Text.SanitizeMentions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user