diff --git a/locale/Messages.resx b/locale/Messages.resx
index 7b9a471..67ec5d4 100644
--- a/locale/Messages.resx
+++ b/locale/Messages.resx
@@ -654,4 +654,13 @@
Your random number is:
+
+ Isn't it obvious?
+
+
+ Minimum number: {0}
+
+
+ Maximum number: {0}
+
diff --git a/locale/Messages.ru.resx b/locale/Messages.ru.resx
index 3e31f8f..dfa7d09 100644
--- a/locale/Messages.ru.resx
+++ b/locale/Messages.ru.resx
@@ -654,4 +654,13 @@
Ваше случайное число:
+
+ Разве это не очевидно?
+
+
+ Максимальное число: {0}
+
+
+ Минимальное число: {0}
+
diff --git a/locale/Messages.tt-ru.resx b/locale/Messages.tt-ru.resx
index df98622..7a6bfe8 100644
--- a/locale/Messages.tt-ru.resx
+++ b/locale/Messages.tt-ru.resx
@@ -654,4 +654,13 @@
ваше рандомное число:
+
+ ну чувак...
+
+
+ наибольшее: {0}
+
+
+ наименьшее: {0}
+
diff --git a/src/Commands/ToolsCommandGroup.cs b/src/Commands/ToolsCommandGroup.cs
index 64e6729..e19f484 100644
--- a/src/Commands/ToolsCommandGroup.cs
+++ b/src/Commands/ToolsCommandGroup.cs
@@ -243,8 +243,8 @@ public class ToolsCommandGroup : CommandGroup
[UsedImplicitly]
public async Task ExecuteRandomAsync(
[Description("Maximum number")] int max,
- [Description("Minumum number (Default: 1)")]
- int min = 1)
+ [Description("Minumum number (Default: 0)")]
+ int min = 0)
{
if (!_context.TryGetContextIDs(out var guildId, out _, out var userId))
{
@@ -282,9 +282,19 @@ public class ToolsCommandGroup : CommandGroup
var i = Random.Shared.Next(min, max + 1);
+ var description = new StringBuilder().Append("# ").AppendLine(i.ToString())
+ .Append("- ").AppendLine(string.Format(Messages.RandomMin, Markdown.InlineCode(min.ToString())))
+ .Append("- ").AppendLine(string.Format(Messages.RandomMax, Markdown.InlineCode(max.ToString())));
+ var embedColor = ColorsList.Blue;
+ if (min == max)
+ {
+ description.AppendLine(Markdown.Italicise(Messages.RandomObvious));
+ embedColor = ColorsList.Red;
+ }
+
var embed = new EmbedBuilder().WithSmallTitle(Messages.RandomOutput, user)
- .WithDescription($"# {i}\n({min}-{max})")
- .WithColour(ColorsList.Blue)
+ .WithDescription(description.ToString())
+ .WithColour(embedColor)
.Build();
return await _feedback.SendContextualEmbedResultAsync(embed, ct);
diff --git a/src/Messages.Designer.cs b/src/Messages.Designer.cs
index 3c2c747..cd5a67f 100644
--- a/src/Messages.Designer.cs
+++ b/src/Messages.Designer.cs
@@ -1135,5 +1135,26 @@ namespace Octobot {
return ResourceManager.GetString("RandomOutput", resourceCulture);
}
}
+
+ internal static string RandomObvious
+ {
+ get {
+ return ResourceManager.GetString("RandomObvious", resourceCulture);
+ }
+ }
+
+ internal static string RandomMax
+ {
+ get {
+ return ResourceManager.GetString("RandomMax", resourceCulture);
+ }
+ }
+
+ internal static string RandomMin
+ {
+ get {
+ return ResourceManager.GetString("RandomMin", resourceCulture);
+ }
+ }
}
}