mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 00:19:00 +03:00
/about: Add repository link button (#218)
In this PR, I moved the repository link from the embed to a button in /about command for better UI/UX --------- Signed-off-by: Macintxsh <95250141+mctaylors@users.noreply.github.com>
This commit is contained in:
parent
541e18fff0
commit
2dc5220f46
1 changed files with 15 additions and 3 deletions
|
@ -8,9 +8,11 @@ using Remora.Commands.Attributes;
|
|||
using Remora.Commands.Groups;
|
||||
using Remora.Discord.API.Abstractions.Objects;
|
||||
using Remora.Discord.API.Abstractions.Rest;
|
||||
using Remora.Discord.API.Objects;
|
||||
using Remora.Discord.Commands.Attributes;
|
||||
using Remora.Discord.Commands.Conditions;
|
||||
using Remora.Discord.Commands.Contexts;
|
||||
using Remora.Discord.Commands.Feedback.Messages;
|
||||
using Remora.Discord.Commands.Feedback.Services;
|
||||
using Remora.Discord.Extensions.Embeds;
|
||||
using Remora.Rest.Core;
|
||||
|
@ -31,6 +33,8 @@ public class AboutCommandGroup : CommandGroup
|
|||
("neroduckale", new Snowflake(474943797063843851))
|
||||
};
|
||||
|
||||
private const string RepositoryUrl = "https://github.com/LabsDevelopment/Octobot";
|
||||
|
||||
private readonly ICommandContext _context;
|
||||
private readonly IFeedbackService _feedback;
|
||||
private readonly GuildDataService _guildData;
|
||||
|
@ -91,14 +95,22 @@ public class AboutCommandGroup : CommandGroup
|
|||
builder.AppendBulletPointLine($"{tag} — {$"AboutDeveloper@{dev.Username}".Localized()}");
|
||||
}
|
||||
|
||||
builder.Append($"### [{Messages.AboutTitleRepository}](https://github.com/LabsDevelopment/Octobot)");
|
||||
|
||||
var embed = new EmbedBuilder().WithSmallTitle(Messages.AboutBot, bot)
|
||||
.WithDescription(builder.ToString())
|
||||
.WithColour(ColorsList.Cyan)
|
||||
.WithImageUrl("https://cdn.mctaylors.ru/octobot-banner.png")
|
||||
.Build();
|
||||
|
||||
return await _feedback.SendContextualEmbedResultAsync(embed, ct: ct);
|
||||
var button = new ButtonComponent(
|
||||
ButtonComponentStyle.Link,
|
||||
Messages.AboutTitleRepository,
|
||||
URL: RepositoryUrl
|
||||
);
|
||||
|
||||
return await _feedback.SendContextualEmbedResultAsync(embed,
|
||||
new FeedbackMessageOptions(MessageComponents: new[]
|
||||
{
|
||||
new ActionRowComponent(new[] { button })
|
||||
}), ct);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue