fix issues with field content length

This commit is contained in:
13xforever 2020-06-02 17:22:37 +05:00
parent 94c6b78162
commit 57e07b04ae
2 changed files with 3 additions and 3 deletions

View File

@ -261,7 +261,7 @@ namespace CompatBot.Utils
}.AddField("Violator", author == null ? message.Author.Mention : GetMentionWithNickname(author), true)
.AddField("Channel", message.Channel.IsPrivate ? "Bot's DM" : message.Channel.Mention, true)
//.AddField("Time (UTC)", message.CreationTimestamp.ToString("yyyy-MM-dd HH:mm:ss"), true)
.AddField("Content of the offending item", content);
.AddField("Content of the offending item", content.Trim(EmbedPager.MaxFieldLength));
if (!string.IsNullOrEmpty(actionList))
result.AddField("Filter Actions", actionList, true);
if (needsAttention && !message.Channel.IsPrivate)

View File

@ -119,7 +119,7 @@ namespace CompatBot.Utils.ResultFormatters
#else
: $"Fatal Error (x{count})";
#endif
builder.AddField(sectionName, $"```\n{fatalError.Trim(1020)}\n```");
builder.AddField(sectionName, $"```\n{fatalError.Trim(EmbedPager.MaxFieldLength - 8)}\n```");
}
}
}
@ -128,7 +128,7 @@ namespace CompatBot.Utils.ResultFormatters
if (unimplementedSyscall.Contains("syscall_988"))
{
var fatalError = "Unimplemented syscall " + unimplementedSyscall;
builder.AddField("Fatal Error", $"```{fatalError.Trim(1022)}```");
builder.AddField("Fatal Error", $"```\n{fatalError.Trim(EmbedPager.MaxFieldLength - 8)}\n```");
if (items["ppu_decoder"] is string ppuDecoder && ppuDecoder.Contains("Recompiler") && !Config.Colors.CompatStatusPlayable.Equals(builder.Color.Value))
notes.Add("⚠ PPU desync detected; check your save data for corruption and/or try PPU Interpreter");
else