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

i fucked around and i think i found out

Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
Macintxsh 2023-09-28 15:11:16 +03:00
parent 3dbd0646fb
commit ceda77e933
Signed by: mctaylors
GPG key ID: 361D326747B61E65
3 changed files with 13 additions and 12 deletions

View file

@ -529,7 +529,7 @@
<value>Developers:</value>
</data>
<data name="AboutTitleRepository" xml:space="preserve">
<value>Boyfriend's Repository</value>
<value>Boyfriend's source code</value>
</data>
<data name="AboutBot" xml:space="preserve">
<value>About Boyfriend</value>

View file

@ -529,7 +529,7 @@
<value>Разработчики:</value>
</data>
<data name="AboutTitleRepository" xml:space="preserve">
<value>Репозиторий Boyfriend</value>
<value>Исходный код Boyfriend</value>
</data>
<data name="AboutBot" xml:space="preserve">
<value>О Boyfriend</value>

View file

@ -23,14 +23,14 @@ namespace Boyfriend.Commands;
[UsedImplicitly]
public class AboutCommandGroup : CommandGroup
{
private static readonly string[] Developers =
private static readonly string[] DevelopersUsernames =
{ "Octol1ttle", "mctaylors", "neroduckale" };
private static readonly List<ulong> DevelopersIds =
new() { 504343489664909322, 326642240229474304, 474943797063843851 };
private static readonly ulong[] DevelopersIds =
{ 504343489664909322, 326642240229474304, 474943797063843851 };
private static readonly List<Snowflake> DevelopersSnowflakes =
DevelopersIds.ConvertAll(r => r.ToSnowflake());
private static readonly (string[] Usernames, ulong[] Ids) Developers = (
DevelopersUsernames, DevelopersIds);
private readonly ICommandContext _context;
private readonly FeedbackService _feedback;
@ -83,16 +83,17 @@ public class AboutCommandGroup : CommandGroup
private async Task<Result> SendAboutBotAsync(IUser currentUser, Snowflake guildId, CancellationToken ct = default)
{
var builder = new StringBuilder().Append("### ").AppendLine(Messages.AboutTitleDevelopers);
for (var i = 0; i < Developers.Length; i++)
for (var i = 0; i < Developers.Usernames.Length; i++)
{
var tag = $"@{Developers[i]}";
var guildMemberResult = await _guildApi.GetGuildMemberAsync(guildId, DevelopersSnowflakes[i], ct);
var tag = $"@{Developers.Usernames[i]}";
var guildMemberResult = await _guildApi.GetGuildMemberAsync(
guildId, Developers.Ids[i].ToSnowflake(), ct);
if (guildMemberResult.IsSuccess)
{
tag = $"<@{DevelopersIds[i]}>";
tag = $"<@{Developers.Ids[i]}>";
}
builder.AppendLine($"- {tag} — {$"AboutDeveloper@{Developers[i]}".Localized()}");
builder.AppendLine($"- {tag} — {$"AboutDeveloper@{Developers.Usernames[i]}".Localized()}");
}
builder.Append($"### [{Messages.AboutTitleRepository}](https://github.com/LabsDevelopment/Boyfriend)");