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:
parent
0e00069b9d
commit
80129ed4a2
1 changed files with 10 additions and 6 deletions
|
@ -23,11 +23,11 @@ namespace Boyfriend.Commands;
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class AboutCommandGroup : CommandGroup
|
public class AboutCommandGroup : CommandGroup
|
||||||
{
|
{
|
||||||
private static readonly (string Username, ulong Id)[] Developers =
|
private static readonly (string Username, Snowflake Id)[] Developers =
|
||||||
{
|
{
|
||||||
("Octol1ttle", 504343489664909322),
|
("Octol1ttle", new Snowflake(504343489664909322)),
|
||||||
("mctaylors", 326642240229474304),
|
("mctaylors", new Snowflake(326642240229474304)),
|
||||||
("neroduckale", 474943797063843851)
|
("neroduckale", new Snowflake(474943797063843851))
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly ICommandContext _context;
|
private readonly ICommandContext _context;
|
||||||
|
@ -83,9 +83,13 @@ public class AboutCommandGroup : CommandGroup
|
||||||
var builder = new StringBuilder().Append("### ").AppendLine(Messages.AboutTitleDevelopers);
|
var builder = new StringBuilder().Append("### ").AppendLine(Messages.AboutTitleDevelopers);
|
||||||
foreach (var dev in Developers)
|
foreach (var dev in Developers)
|
||||||
{
|
{
|
||||||
|
var tag = $"@{dev.Username}";
|
||||||
var guildMemberResult = await _guildApi.GetGuildMemberAsync(
|
var guildMemberResult = await _guildApi.GetGuildMemberAsync(
|
||||||
guildId, dev.Id.ToSnowflake(), ct);
|
guildId, dev.Id, ct);
|
||||||
var tag = guildMemberResult.IsSuccess ? $"<@{dev.Id}>" : $"@{dev.Username}";
|
if (guildMemberResult.IsSuccess)
|
||||||
|
{
|
||||||
|
tag = $"<@{dev.Id}>";
|
||||||
|
}
|
||||||
|
|
||||||
builder.AppendLine($"- {tag} — {$"AboutDeveloper@{dev.Username}".Localized()}");
|
builder.AppendLine($"- {tag} — {$"AboutDeveloper@{dev.Username}".Localized()}");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue