1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:01:13 +03:00

Disable issue report button if dirty version detected (#275)

In this PR, I'm disabling the Report Issue button if a "dirty" version
is detected. This is done just in case so that "smart" developers don't
accidentally report a bug that they themselves created.

---------

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2024-03-20 15:59:25 +03:00 committed by GitHub
parent ecb92a318c
commit ca49231c86
Signed by: GitHub
GPG key ID: B5690EEEBB952194
8 changed files with 31 additions and 7 deletions

View file

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

View file

@ -669,4 +669,7 @@
<data name="SettingsWelcomeMessagesChannel" xml:space="preserve">
<value>Канал для приветствий</value>
</data>
<data name="ButtonDirty" xml:space="preserve">
<value>Нельзя сообщить о проблеме в версии под разработкой</value>
</data>
</root>

View file

@ -669,4 +669,7 @@
<data name="SettingsWelcomeMessagesChannel" xml:space="preserve">
<value>канал куда говорить здравствуйте</value>
</data>
<data name="ButtonDirty" xml:space="preserve">
<value>вот иди сам и почини что сломал</value>
</data>
</root>

View file

@ -34,7 +34,7 @@ public static class BuildInfo
}
}
private static bool IsDirty
public static bool IsDirty
{
get
{

View file

@ -113,9 +113,12 @@ public class AboutCommandGroup : CommandGroup
var issuesButton = new ButtonComponent(
ButtonComponentStyle.Link,
Messages.ButtonReportIssue,
BuildInfo.IsDirty
? Messages.ButtonDirty
: Messages.ButtonReportIssue,
new PartialEmoji(Name: "⚠️"),
URL: BuildInfo.IssuesUrl
URL: BuildInfo.IssuesUrl,
IsDisabled: BuildInfo.IsDirty
);
return await _feedback.SendContextualEmbedResultAsync(embed,

View file

@ -70,9 +70,12 @@ public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent
var issuesButton = new ButtonComponent(
ButtonComponentStyle.Link,
Messages.ButtonReportIssue,
BuildInfo.IsDirty
? Messages.ButtonDirty
: Messages.ButtonReportIssue,
new PartialEmoji(Name: "⚠️"),
URL: BuildInfo.IssuesUrl
URL: BuildInfo.IssuesUrl,
IsDisabled: BuildInfo.IsDirty
);
return await _feedback.SendContextualEmbedResultAsync(embed,

View file

@ -1204,5 +1204,11 @@ namespace Octobot {
return ResourceManager.GetString("SettingsWelcomeMessagesChannel", resourceCulture);
}
}
internal static string ButtonDirty {
get {
return ResourceManager.GetString("ButtonDirty", resourceCulture);
}
}
}
}

View file

@ -115,9 +115,12 @@ public class GuildLoadedResponder : IResponder<IGuildCreate>
var issuesButton = new ButtonComponent(
ButtonComponentStyle.Link,
Messages.ButtonReportIssue,
BuildInfo.IsDirty
? Messages.ButtonDirty
: Messages.ButtonReportIssue,
new PartialEmoji(Name: "⚠️"),
URL: BuildInfo.IssuesUrl
URL: BuildInfo.IssuesUrl,
IsDisabled: BuildInfo.IsDirty
);
return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed,