mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Resolve conversations.
Co-authored-by: Apceniy <53149450+apceniy@users.noreply.github.com> Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
parent
498f2fb764
commit
7c0277bf0b
1 changed files with 4 additions and 3 deletions
|
@ -266,7 +266,8 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
private async Task<Result> SendRandomNumberAsync(long first, long? secondNullable,
|
private async Task<Result> SendRandomNumberAsync(long first, long? secondNullable,
|
||||||
IUser user, CancellationToken ct)
|
IUser user, CancellationToken ct)
|
||||||
{
|
{
|
||||||
var second = secondNullable ?? 0;
|
const int secondDefault = 0;
|
||||||
|
var second = secondNullable ?? secondDefault;
|
||||||
|
|
||||||
var min = Math.Min(first, second);
|
var min = Math.Min(first, second);
|
||||||
var max = Math.Max(first, second);
|
var max = Math.Max(first, second);
|
||||||
|
@ -277,14 +278,14 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
|
|
||||||
description.AppendLine().Append("- ").Append(string.Format(
|
description.AppendLine().Append("- ").Append(string.Format(
|
||||||
Messages.RandomMin, Markdown.InlineCode(min.ToString())));
|
Messages.RandomMin, Markdown.InlineCode(min.ToString())));
|
||||||
if (secondNullable is null && first >= 0)
|
if (secondNullable is null && first >= secondDefault)
|
||||||
{
|
{
|
||||||
description.Append(' ').Append(Messages.Default);
|
description.Append(' ').Append(Messages.Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
description.AppendLine().Append("- ").Append(string.Format(
|
description.AppendLine().Append("- ").Append(string.Format(
|
||||||
Messages.RandomMax, Markdown.InlineCode(max.ToString())));
|
Messages.RandomMax, Markdown.InlineCode(max.ToString())));
|
||||||
if (secondNullable is null && first < 0)
|
if (secondNullable is null && first < secondDefault)
|
||||||
{
|
{
|
||||||
description.Append(' ').Append(Messages.Default);
|
description.Append(' ').Append(Messages.Default);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue