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

wait a minute, how did I not think of that?

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2024-03-19 22:26:20 +03:00
parent a3668145d9
commit 83a42a46da
Signed by: mctaylors
GPG key ID: 7181BEBE676903C1
4 changed files with 16 additions and 55 deletions

View file

@ -664,6 +664,6 @@
<value>Welcome messages channel</value> <value>Welcome messages channel</value>
</data> </data>
<data name="ButtonDirty" xml:space="preserve"> <data name="ButtonDirty" xml:space="preserve">
<value>Can't report an issue in the under development version</value> <value>Can't report an issue in the development version</value>
</data> </data>
</root> </root>

View file

@ -111,28 +111,14 @@ public class AboutCommandGroup : CommandGroup
URL: BuildInfo.RepositoryUrl URL: BuildInfo.RepositoryUrl
); );
if (BuildInfo.IsDirty)
{
var dirtyButton = new ButtonComponent(
ButtonComponentStyle.Link,
Messages.ButtonDirty,
new PartialEmoji(Name: "⚠️"),
URL: BuildInfo.IssuesUrl,
IsDisabled: true
);
return await _feedback.SendContextualEmbedResultAsync(embed,
new FeedbackMessageOptions(MessageComponents: new[]
{
new ActionRowComponent(new[] { repositoryButton, dirtyButton })
}), ct);
}
var issuesButton = new ButtonComponent( var issuesButton = new ButtonComponent(
ButtonComponentStyle.Link, ButtonComponentStyle.Link,
Messages.ButtonReportIssue, BuildInfo.IsDirty
? Messages.ButtonReportIssue
: Messages.ButtonDirty,
new PartialEmoji(Name: "⚠️"), new PartialEmoji(Name: "⚠️"),
URL: BuildInfo.IssuesUrl URL: BuildInfo.IssuesUrl,
IsDisabled: BuildInfo.IsDirty
); );
return await _feedback.SendContextualEmbedResultAsync(embed, return await _feedback.SendContextualEmbedResultAsync(embed,

View file

@ -68,28 +68,14 @@ public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent
.WithColour(ColorsList.Red) .WithColour(ColorsList.Red)
.Build(); .Build();
if (BuildInfo.IsDirty)
{
var dirtyButton = new ButtonComponent(
ButtonComponentStyle.Link,
Messages.ButtonDirty,
new PartialEmoji(Name: "⚠️"),
URL: BuildInfo.IssuesUrl,
IsDisabled: true
);
return await _feedback.SendContextualEmbedResultAsync(embed,
new FeedbackMessageOptions(MessageComponents: new[]
{
new ActionRowComponent(new[] { dirtyButton })
}), ct);
}
var issuesButton = new ButtonComponent( var issuesButton = new ButtonComponent(
ButtonComponentStyle.Link, ButtonComponentStyle.Link,
Messages.ButtonReportIssue, BuildInfo.IsDirty
? Messages.ButtonReportIssue
: Messages.ButtonDirty,
new PartialEmoji(Name: "⚠️"), new PartialEmoji(Name: "⚠️"),
URL: BuildInfo.IssuesUrl URL: BuildInfo.IssuesUrl,
IsDisabled: BuildInfo.IsDirty
); );
return await _feedback.SendContextualEmbedResultAsync(embed, return await _feedback.SendContextualEmbedResultAsync(embed,

View file

@ -113,25 +113,14 @@ public class GuildLoadedResponder : IResponder<IGuildCreate>
.WithColour(ColorsList.Red) .WithColour(ColorsList.Red)
.Build(); .Build();
if (BuildInfo.IsDirty)
{
var dirtyButton = new ButtonComponent(
ButtonComponentStyle.Link,
Messages.ButtonDirty,
new PartialEmoji(Name: "⚠️"),
URL: BuildInfo.IssuesUrl,
IsDisabled: true
);
return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed,
components: new[] { new ActionRowComponent(new[] { dirtyButton }) }, ct: ct);
}
var issuesButton = new ButtonComponent( var issuesButton = new ButtonComponent(
ButtonComponentStyle.Link, ButtonComponentStyle.Link,
Messages.ButtonReportIssue, BuildInfo.IsDirty
? Messages.ButtonReportIssue
: Messages.ButtonDirty,
new PartialEmoji(Name: "⚠️"), new PartialEmoji(Name: "⚠️"),
URL: BuildInfo.IssuesUrl URL: BuildInfo.IssuesUrl,
IsDisabled: BuildInfo.IsDirty
); );
return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed, return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed,