mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-04 00:34:26 -05:00 
			
		
		
		
	Potential fix for no-show quoteshow
This commit is contained in:
		@@ -127,15 +127,27 @@ public partial class Utility
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private async Task ShowQuoteData(Quote data)
 | 
			
		||||
            => await ctx.Channel.EmbedAsync(_eb.Create(ctx)
 | 
			
		||||
                .WithOkColor()
 | 
			
		||||
                .WithTitle(GetText(strs.quote_id($"#{data.Id}")))
 | 
			
		||||
                .AddField(GetText(strs.trigger), data.Keyword)
 | 
			
		||||
                .AddField(GetText(strs.response),
 | 
			
		||||
                    Format.Sanitize(data.Text).Replace("](", "]\\("))
 | 
			
		||||
                .WithFooter(
 | 
			
		||||
                    GetText(strs.created_by($"{data.AuthorName} ({data.AuthorId})"))));
 | 
			
		||||
        {
 | 
			
		||||
            var eb = _eb.Create(ctx)
 | 
			
		||||
                          .WithOkColor()
 | 
			
		||||
                          .WithTitle($"{GetText(strs.quote_id($"#{data.Id}"))} | {GetText(strs.response)}:")
 | 
			
		||||
                          .WithDescription(Format.Sanitize(data.Text).Replace("](", "]\\(").TrimTo(4096))
 | 
			
		||||
                          .AddField(GetText(strs.trigger), data.Keyword)
 | 
			
		||||
                          .WithFooter(
 | 
			
		||||
                              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)
 | 
			
		||||
        {
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(textOrAuthor))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user