1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-21 05:00:56 +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:
Macintxsh 2023-12-17 21:35:09 +03:00 committed by GitHub
parent 4581b402aa
commit 4dc460a269
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 68 additions and 20 deletions

View file

@ -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);
}
}