mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
resolving conversations...
Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
parent
70f8846066
commit
4d54793cc6
1 changed files with 9 additions and 4 deletions
|
@ -230,8 +230,10 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A slash command that generates a random number.
|
/// A slash command that generates a random number using maximum and minimum numbers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="max">The maximum number for randomization.</param>
|
||||||
|
/// <param name="min">The minimum number for randomization. Default value: 1</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// A feedback sending result which may or may not have succeeded.
|
/// A feedback sending result which may or may not have succeeded.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
@ -244,7 +246,7 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
[Description("Minumum number (Default: 1)")]
|
[Description("Minumum number (Default: 1)")]
|
||||||
int min = 1)
|
int min = 1)
|
||||||
{
|
{
|
||||||
if (!_context.TryGetContextIDs(out _, out _, out var userId))
|
if (!_context.TryGetContextIDs(out var guildId, out _, out var userId))
|
||||||
{
|
{
|
||||||
return new ArgumentInvalidError(nameof(_context), "Unable to retrieve necessary IDs from command context");
|
return new ArgumentInvalidError(nameof(_context), "Unable to retrieve necessary IDs from command context");
|
||||||
}
|
}
|
||||||
|
@ -261,10 +263,13 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
return Result.FromError(userResult);
|
return Result.FromError(userResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await SendRandomAsync(max, min, user, currentUser, CancellationToken);
|
var data = await _guildData.GetData(guildId, CancellationToken);
|
||||||
|
Messages.Culture = GuildSettings.Language.Get(data.Settings);
|
||||||
|
|
||||||
|
return await SendRandomNumberAsync(max, min, user, currentUser, CancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<Result> SendRandomAsync(int max, int min, IUser user, IUser currentUser, CancellationToken ct)
|
private async Task<Result> SendRandomNumberAsync(int max, int min, IUser user, IUser currentUser, CancellationToken ct)
|
||||||
{
|
{
|
||||||
if (min > max)
|
if (min > max)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue