1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 00:43:36 +03:00

github editing moment x6

Signed-off-by: Macintosh II <95250141+mctaylors@users.noreply.github.com>
This commit is contained in:
Macintxsh 2023-10-02 11:30:56 +03:00 committed by GitHub
parent 6adb25ad6f
commit 0ed4e165bc
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,6 +82,12 @@ public class ToolsCommandGroup : CommandGroup
return Result.FromError(userResult); return Result.FromError(userResult);
} }
var currentUserResult = await _userApi.GetCurrentUserAsync(CancellationToken);
if (!currentUserResult.IsDefined(out var currentUser))
{
return Result.FromError(currentUserResult);
}
var data = await _guildData.GetData(guildId, CancellationToken); var data = await _guildData.GetData(guildId, CancellationToken);
Messages.Culture = GuildSettings.Language.Get(data.Settings); Messages.Culture = GuildSettings.Language.Get(data.Settings);
@ -245,12 +251,6 @@ public class ToolsCommandGroup : CommandGroup
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");
} }
var currentUserResult = await _userApi.GetCurrentUserAsync(CancellationToken);
if (!currentUserResult.IsDefined(out var currentUser))
{
return Result.FromError(currentUserResult);
}
var userResult = await _userApi.GetUserAsync(userId, CancellationToken); var userResult = await _userApi.GetUserAsync(userId, CancellationToken);
if (!userResult.IsDefined(out var user)) if (!userResult.IsDefined(out var user))
{ {