diff --git a/locale/Messages.resx b/locale/Messages.resx index c2be4cd..79526a8 100644 --- a/locale/Messages.resx +++ b/locale/Messages.resx @@ -663,4 +663,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 dirty version</value> + </data> </root> diff --git a/locale/Messages.ru.resx b/locale/Messages.ru.resx index d38509c..06d5354 100644 --- a/locale/Messages.ru.resx +++ b/locale/Messages.ru.resx @@ -663,4 +663,7 @@ <data name="SettingsWelcomeMessagesChannel" xml:space="preserve"> <value>Канал для приветствий</value> </data> + <data name="ButtonDirty" xml:space="preserve"> + <value>Нельзя сообщить о проблеме в dirty версии</value> + </data> </root> diff --git a/locale/Messages.tt-ru.resx b/locale/Messages.tt-ru.resx index dfb1ee6..31453d8 100644 --- a/locale/Messages.tt-ru.resx +++ b/locale/Messages.tt-ru.resx @@ -663,4 +663,7 @@ <data name="SettingsWelcomeMessagesChannel" xml:space="preserve"> <value>канал куда говорить здравствуйте</value> </data> + <data name="ButtonDirty" xml:space="preserve"> + <value>вот иди сам и почини что сломал</value> + </data> </root> diff --git a/src/BuildInfo.cs b/src/BuildInfo.cs index 50f86a2..c704328 100644 --- a/src/BuildInfo.cs +++ b/src/BuildInfo.cs @@ -34,7 +34,7 @@ public static class BuildInfo } } - private static bool IsDirty + public static bool IsDirty { get { diff --git a/src/Commands/AboutCommandGroup.cs b/src/Commands/AboutCommandGroup.cs index 05b1855..88ac423 100644 --- a/src/Commands/AboutCommandGroup.cs +++ b/src/Commands/AboutCommandGroup.cs @@ -111,6 +111,22 @@ public class AboutCommandGroup : CommandGroup URL: BuildInfo.RepositoryUrl ); + if (BuildInfo.IsDirty) + { + var dirtyButton = new ButtonComponent( + ButtonComponentStyle.Link, + Messages.ButtonDirty, + new PartialEmoji(Name: "⚠️"), + IsDisabled: true + ); + + return await _feedback.SendContextualEmbedResultAsync(embed, + new FeedbackMessageOptions(MessageComponents: new[] + { + new ActionRowComponent(new[] { repositoryButton, dirtyButton }) + }), ct); + } + var issuesButton = new ButtonComponent( ButtonComponentStyle.Link, Messages.ButtonReportIssue, diff --git a/src/Commands/Events/ErrorLoggingPostExecutionEvent.cs b/src/Commands/Events/ErrorLoggingPostExecutionEvent.cs index 5d7830b..8f06423 100644 --- a/src/Commands/Events/ErrorLoggingPostExecutionEvent.cs +++ b/src/Commands/Events/ErrorLoggingPostExecutionEvent.cs @@ -68,6 +68,22 @@ public class ErrorLoggingPostExecutionEvent : IPostExecutionEvent .WithColour(ColorsList.Red) .Build(); + if (BuildInfo.IsDirty) + { + var dirtyButton = new ButtonComponent( + ButtonComponentStyle.Link, + Messages.ButtonDirty, + new PartialEmoji(Name: "⚠️"), + IsDisabled: true + ); + + return await _feedback.SendContextualEmbedResultAsync(embed, + new FeedbackMessageOptions(MessageComponents: new[] + { + new ActionRowComponent(new[] { dirtyButton }) + }), ct); + } + var issuesButton = new ButtonComponent( ButtonComponentStyle.Link, Messages.ButtonReportIssue, diff --git a/src/Messages.Designer.cs b/src/Messages.Designer.cs index 707c814..2a8ae0d 100644 --- a/src/Messages.Designer.cs +++ b/src/Messages.Designer.cs @@ -1196,5 +1196,11 @@ namespace Octobot { return ResourceManager.GetString("SettingsWelcomeMessagesChannel", resourceCulture); } } + + internal static string ButtonDirty { + get { + return ResourceManager.GetString("ButtonDirty", resourceCulture); + } + } } } diff --git a/src/Responders/GuildLoadedResponder.cs b/src/Responders/GuildLoadedResponder.cs index c493910..fb53bb9 100644 --- a/src/Responders/GuildLoadedResponder.cs +++ b/src/Responders/GuildLoadedResponder.cs @@ -113,6 +113,19 @@ public class GuildLoadedResponder : IResponder<IGuildCreate> .WithColour(ColorsList.Red) .Build(); + if (BuildInfo.IsDirty) + { + var dirtyButton = new ButtonComponent( + ButtonComponentStyle.Link, + Messages.ButtonDirty, + new PartialEmoji(Name: "⚠️"), + IsDisabled: true + ); + + return await _channelApi.CreateMessageWithEmbedResultAsync(channel, embedResult: errorEmbed, + components: new[] { new ActionRowComponent(new[] { dirtyButton }) }, ct: ct); + } + var issuesButton = new ButtonComponent( ButtonComponentStyle.Link, Messages.ButtonReportIssue,