normal quote responses now have replacements too, not only embeds
This commit is contained in:
parent
ed3ccbf6d9
commit
cedf08b128
@ -67,17 +67,18 @@ namespace NadekoBot.Modules.Utility
|
|||||||
if (quote == null)
|
if (quote == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var rep = new ReplacementBuilder()
|
||||||
|
.WithDefault(Context)
|
||||||
|
.Build();
|
||||||
|
|
||||||
if (CREmbed.TryParse(quote.Text, out var crembed))
|
if (CREmbed.TryParse(quote.Text, out var crembed))
|
||||||
{
|
{
|
||||||
new ReplacementBuilder()
|
rep.Replace(crembed);
|
||||||
.WithDefault(Context)
|
|
||||||
.Build()
|
|
||||||
.Replace(crembed);
|
|
||||||
await Context.Channel.EmbedAsync(crembed.ToEmbed(), crembed.PlainText?.SanitizeMentions() ?? "")
|
await Context.Channel.EmbedAsync(crembed.ToEmbed(), crembed.PlainText?.SanitizeMentions() ?? "")
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await Context.Channel.SendMessageAsync($"`#{quote.Id}` 📣 " + quote.Text.SanitizeMentions());
|
await Context.Channel.SendMessageAsync($"`#{quote.Id}` 📣 " + rep.Replace(quote.Text)?.SanitizeMentions());
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
@ -115,16 +116,17 @@ namespace NadekoBot.Modules.Utility
|
|||||||
{
|
{
|
||||||
var qfromid = uow.Quotes.Get(id);
|
var qfromid = uow.Quotes.Get(id);
|
||||||
|
|
||||||
|
var rep = new ReplacementBuilder()
|
||||||
|
.WithDefault(Context)
|
||||||
|
.Build();
|
||||||
|
|
||||||
if (qfromid == null)
|
if (qfromid == null)
|
||||||
{
|
{
|
||||||
await Context.Channel.SendErrorAsync(GetText("quotes_notfound"));
|
await Context.Channel.SendErrorAsync(GetText("quotes_notfound"));
|
||||||
}
|
}
|
||||||
else if (CREmbed.TryParse(qfromid.Text, out var crembed))
|
else if (CREmbed.TryParse(qfromid.Text, out var crembed))
|
||||||
{
|
{
|
||||||
new ReplacementBuilder()
|
rep.Replace(crembed);
|
||||||
.WithDefault(Context)
|
|
||||||
.Build()
|
|
||||||
.Replace(crembed);
|
|
||||||
|
|
||||||
await Context.Channel.EmbedAsync(crembed.ToEmbed(), crembed.PlainText?.SanitizeMentions() ?? "")
|
await Context.Channel.EmbedAsync(crembed.ToEmbed(), crembed.PlainText?.SanitizeMentions() ?? "")
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
@ -132,7 +134,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
await Context.Channel.SendMessageAsync($"`#{qfromid.Id}` 🗯️ " + qfromid.Keyword.ToLowerInvariant().SanitizeMentions() + ": " +
|
await Context.Channel.SendMessageAsync($"`#{qfromid.Id}` 🗯️ " + qfromid.Keyword.ToLowerInvariant().SanitizeMentions() + ": " +
|
||||||
qfromid.Text.SanitizeMentions());
|
rep.Replace(qfromid.Text)?.SanitizeMentions());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user