fix another instance of discord bullshittery

This commit is contained in:
13xforever 2019-08-31 21:05:46 +05:00
parent e2f6916b60
commit 9163625dc2
3 changed files with 5 additions and 4 deletions

View File

@ -287,7 +287,7 @@ Example usage:
{
var info = resultInfo.AsString();
#if DEBUG
info = $"`{CompatApiResultUtils.GetScore(request.search, resultInfo.info):0.000000}` {info}";
info = $"{StringUtils.InvisibleSpacer}`{CompatApiResultUtils.GetScore(request.search, resultInfo.info):0.000000}` {info}";
#endif
result.AppendLine(info);
}

View File

@ -19,6 +19,7 @@ namespace CompatBot.Utils
private static readonly Encoding Utf8 = new UTF8Encoding(false);
private static readonly MemoryCache FuzzyPairCache = new MemoryCache(new MemoryCacheOptions {ExpirationScanFrequency = TimeSpan.FromMinutes(10)});
private const char StrikeThroughChar = '\u0336'; // 0x0335 = short dash, 0x0336 = long dash, 0x0337 = short slash, 0x0338 = long slash
public const char InvisibleSpacer = '\u206a';
private static readonly HashSet<char> SpaceCharacters = new HashSet<char>
{
@ -135,8 +136,8 @@ namespace CompatBot.Utils
public static string GetSuffix(long num) => num == 1 ? "" : "s";
public static string FixSpaces(this string text) => text?.Replace(" ", " \u206a")
.Replace("`", "\u206a`")
public static string FixSpaces(this string text) => text?.Replace(" ", " " + InvisibleSpacer)
.Replace("`", InvisibleSpacer + "`")
.Replace(Environment.NewLine, "\n");
public static int GetVisibleLength(this string s)

View File

@ -48,7 +48,7 @@ namespace CompatBot.Utils.ResultFormatters
if (StatusColors.TryGetValue(info.Status, out _))
{
var title = info.Title.Trim(40);
return $"`[{titleId,-9}] {title,-40} {info.Status,8} since {info.ToUpdated(),-10} (PR {info.ToPrString("#????"),-5})` https://forums.rpcs3.net/thread-{info.Thread}.html";
return $"{StringUtils.InvisibleSpacer}`[{titleId,-9}] {title,-40} {info.Status,8} since {info.ToUpdated(),-10} (PR {info.ToPrString("#????"),-5})` https://forums.rpcs3.net/thread-{info.Thread}.html{StringUtils.InvisibleSpacer}";
}
return $"Product code {titleId} was not found in compatibility database";