mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-05 21:46:28 +03:00
Add issue button w/ some button updates (#221)
In this PR, I've added a "Report an issue" button and a few more button-related changes: - Add "Report an issue" button - Add icon for "Octobot's source code" - Rename `AboutTitleRepository` to `ButtonOpenRepository` - Rename `OpenEventInfoButton` to `ButtonOpenEventInfo` to be consistent with other language string names - Rename `ColorsList.cs` to `Miscellaneous.cs` - Add public const strings in `Octobot.cs` to get repository & issues links --------- Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
4581b402aa
commit
4dc460a269
9 changed files with 68 additions and 20 deletions
|
@ -33,8 +33,6 @@ 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;
|
||||
|
@ -101,16 +99,24 @@ public class AboutCommandGroup : CommandGroup
|
|||
.WithImageUrl("https://cdn.mctaylors.ru/octobot-banner.png")
|
||||
.Build();
|
||||
|
||||
var button = new ButtonComponent(
|
||||
var repositoryButton = new ButtonComponent(
|
||||
ButtonComponentStyle.Link,
|
||||
Messages.AboutTitleRepository,
|
||||
URL: RepositoryUrl
|
||||
Messages.ButtonOpenRepository,
|
||||
new PartialEmoji(Name: "🌐"),
|
||||
URL: Octobot.RepositoryUrl
|
||||
);
|
||||
|
||||
var issuesButton = new ButtonComponent(
|
||||
ButtonComponentStyle.Link,
|
||||
Messages.ButtonReportIssue,
|
||||
new PartialEmoji(Name: "⚠️"),
|
||||
URL: Octobot.IssuesUrl
|
||||
);
|
||||
|
||||
return await _feedback.SendContextualEmbedResultAsync(embed,
|
||||
new FeedbackMessageOptions(MessageComponents: new[]
|
||||
{
|
||||
new ActionRowComponent(new[] { button })
|
||||
new ActionRowComponent(new[] { repositoryButton, issuesButton })
|
||||
}), ct);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Octobot.Extensions;
|
||||
using Remora.Discord.API.Abstractions.Objects;
|
||||
using Remora.Discord.API.Abstractions.Rest;
|
||||
using Remora.Discord.API.Objects;
|
||||
using Remora.Discord.Commands.Contexts;
|
||||
using Remora.Discord.Commands.Feedback.Messages;
|
||||
using Remora.Discord.Commands.Feedback.Services;
|
||||
using Remora.Discord.Commands.Services;
|
||||
using Remora.Discord.Extensions.Embeds;
|
||||
|
@ -65,6 +68,17 @@ public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent
|
|||
.WithColour(ColorsList.Red)
|
||||
.Build();
|
||||
|
||||
return await _feedback.SendContextualEmbedResultAsync(embed, ct: ct);
|
||||
var issuesButton = new ButtonComponent(
|
||||
ButtonComponentStyle.Link,
|
||||
Messages.ButtonReportIssue,
|
||||
new PartialEmoji(Name: "⚠️"),
|
||||
URL: Octobot.IssuesUrl
|
||||
);
|
||||
|
||||
return await _feedback.SendContextualEmbedResultAsync(embed,
|
||||
new FeedbackMessageOptions(MessageComponents: new[]
|
||||
{
|
||||
new ActionRowComponent(new[] { issuesButton })
|
||||
}), ct);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue