mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Merge branch 'v4' into 'v4'
Potential fix for no-show quoteshow See merge request Kwoth/nadekobot!311
This commit is contained in:
@@ -127,15 +127,27 @@ public partial class Utility
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async Task ShowQuoteData(Quote data)
|
private async Task ShowQuoteData(Quote data)
|
||||||
=> await ctx.Channel.EmbedAsync(_eb.Create(ctx)
|
{
|
||||||
.WithOkColor()
|
var eb = _eb.Create(ctx)
|
||||||
.WithTitle(GetText(strs.quote_id($"#{data.Id}")))
|
.WithOkColor()
|
||||||
.AddField(GetText(strs.trigger), data.Keyword)
|
.WithTitle($"{GetText(strs.quote_id($"#{data.Id}"))} | {GetText(strs.response)}:")
|
||||||
.AddField(GetText(strs.response),
|
.WithDescription(Format.Sanitize(data.Text).Replace("](", "]\\(").TrimTo(4096))
|
||||||
Format.Sanitize(data.Text).Replace("](", "]\\("))
|
.AddField(GetText(strs.trigger), data.Keyword)
|
||||||
.WithFooter(
|
.WithFooter(
|
||||||
GetText(strs.created_by($"{data.AuthorName} ({data.AuthorId})"))));
|
GetText(strs.created_by($"{data.AuthorName} ({data.AuthorId})")))
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
if (!(data.Text.Length > 4096))
|
||||||
|
{
|
||||||
|
await ctx.Channel.SendMessageAsync(embed: eb);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await ctx.Channel.SendFileAsync(
|
||||||
|
attachment: new FileAttachment(await data.Text.ToStream(), "quote.txt"),
|
||||||
|
embed: eb);
|
||||||
|
}
|
||||||
|
|
||||||
private async Task QuoteSearchinternalAsync(string? keyword, string textOrAuthor)
|
private async Task QuoteSearchinternalAsync(string? keyword, string textOrAuthor)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(textOrAuthor))
|
if (string.IsNullOrWhiteSpace(textOrAuthor))
|
||||||
|
Reference in New Issue
Block a user