1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 00:43:36 +03:00

use snowflakes

Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
Macintxsh 2023-09-29 18:01:51 +03:00
parent 0e00069b9d
commit 80129ed4a2
Signed by: mctaylors
GPG key ID: 361D326747B61E65

View file

@ -23,11 +23,11 @@ namespace Boyfriend.Commands;
[UsedImplicitly]
public class AboutCommandGroup : CommandGroup
{
private static readonly (string Username, ulong Id)[] Developers =
private static readonly (string Username, Snowflake Id)[] Developers =
{
("Octol1ttle", 504343489664909322),
("mctaylors", 326642240229474304),
("neroduckale", 474943797063843851)
("Octol1ttle", new Snowflake(504343489664909322)),
("mctaylors", new Snowflake(326642240229474304)),
("neroduckale", new Snowflake(474943797063843851))
};
private readonly ICommandContext _context;
@ -83,9 +83,13 @@ public class AboutCommandGroup : CommandGroup
var builder = new StringBuilder().Append("### ").AppendLine(Messages.AboutTitleDevelopers);
foreach (var dev in Developers)
{
var tag = $"@{dev.Username}";
var guildMemberResult = await _guildApi.GetGuildMemberAsync(
guildId, dev.Id.ToSnowflake(), ct);
var tag = guildMemberResult.IsSuccess ? $"<@{dev.Id}>" : $"@{dev.Username}";
guildId, dev.Id, ct);
if (guildMemberResult.IsSuccess)
{
tag = $"<@{dev.Id}>";
}
builder.AppendLine($"- {tag} — {$"AboutDeveloper@{dev.Username}".Localized()}");
}