mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Resolve conversations pt.3
Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
parent
896267c0e5
commit
6b438bdd60
1 changed files with 6 additions and 8 deletions
|
@ -365,17 +365,15 @@ public class MuteCommandGroup : CommandGroup
|
||||||
return Result.FromSuccess();
|
return Result.FromSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
var muteResult = await _guildApi.ModifyGuildMemberAsync(
|
var unmuteResult = await _guildApi.ModifyGuildMemberAsync(
|
||||||
guildId, target.ID, roles: memberData.Roles.ConvertAll(r => r.ToSnowflake()),
|
guildId, target.ID, roles: memberData.Roles.ConvertAll(r => r.ToSnowflake()),
|
||||||
reason: $"({user.GetTag()}) {reason}".EncodeHeader(), ct: ct);
|
reason: $"({user.GetTag()}) {reason}".EncodeHeader(), ct: ct);
|
||||||
if (!muteResult.IsSuccess)
|
if (unmuteResult.IsSuccess)
|
||||||
{
|
{
|
||||||
return Result.FromError(muteResult.Error);
|
memberData.MutedUntil = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
memberData.MutedUntil = null;
|
return unmuteResult;
|
||||||
|
|
||||||
return Result.FromSuccess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<Result> RemoveTimeoutAsync(
|
private async Task<Result> RemoveTimeoutAsync(
|
||||||
|
@ -387,9 +385,9 @@ public class MuteCommandGroup : CommandGroup
|
||||||
return Result.FromSuccess();
|
return Result.FromSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
var muteResult = await _guildApi.ModifyGuildMemberAsync(
|
var unmuteResult = await _guildApi.ModifyGuildMemberAsync(
|
||||||
guildId, target.ID, reason: $"({user.GetTag()}) {reason}".EncodeHeader(),
|
guildId, target.ID, reason: $"({user.GetTag()}) {reason}".EncodeHeader(),
|
||||||
communicationDisabledUntil: null, ct: ct);
|
communicationDisabledUntil: null, ct: ct);
|
||||||
return !muteResult.IsSuccess ? Result.FromError(muteResult.Error) : Result.FromSuccess();
|
return unmuteResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue