mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-02 16:06:51 +00:00
fix another instance of discord bullshittery
This commit is contained in:
parent
e2f6916b60
commit
9163625dc2
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user