forked from TeamInklings/Octobot
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:
parent
ecb92a318c
commit
ca49231c86
8 changed files with 31 additions and 7 deletions
|
@ -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>
|
||||
|
|
|
@ -669,4 +669,7 @@
|
|||
<data name="SettingsWelcomeMessagesChannel" xml:space="preserve">
|
||||
<value>Канал для приветствий</value>
|
||||
</data>
|
||||
<data name="ButtonDirty" xml:space="preserve">
|
||||
<value>Нельзя сообщить о проблеме в версии под разработкой</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
|
@ -669,4 +669,7 @@
|
|||
<data name="SettingsWelcomeMessagesChannel" xml:space="preserve">
|
||||
<value>канал куда говорить здравствуйте</value>
|
||||
</data>
|
||||
<data name="ButtonDirty" xml:space="preserve">
|
||||
<value>вот иди сам и почини что сломал</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
|
@ -34,7 +34,7 @@ public static class BuildInfo
|
|||
}
|
||||
}
|
||||
|
||||
private static bool IsDirty
|
||||
public static bool IsDirty
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
6
src/Messages.Designer.cs
generated
6
src/Messages.Designer.cs
generated
|
@ -1204,5 +1204,11 @@ namespace Octobot {
|
|||
return ResourceManager.GetString("SettingsWelcomeMessagesChannel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ButtonDirty {
|
||||
get {
|
||||
return ResourceManager.GetString("ButtonDirty", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Reference in a new issue