mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-01 03:29:54 +03:00
Use DateTimeOffset#UtcNow instead of DateTimeOffset#Now (UtcNow is actually faster lol)
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
41958deb0a
commit
cdfa0e11f7
8 changed files with 28 additions and 21 deletions
|
@ -19,7 +19,7 @@ public sealed class MuteCommand : ICommand {
|
|||
if ((role is not null && toMute.Roles.Contains(role))
|
||||
|| (toMute.TimedOutUntil is not null
|
||||
&& toMute.TimedOutUntil.Value
|
||||
> DateTimeOffset.Now)) {
|
||||
> DateTimeOffset.UtcNow)) {
|
||||
cmd.Reply(Messages.MemberAlreadyMuted, ReplyEmojis.Error);
|
||||
return;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public sealed class MuteCommand : ICommand {
|
|||
var memberData = data.MemberData[toMute.Id];
|
||||
|
||||
if (role is not null) {
|
||||
memberData.MutedUntil = DateTimeOffset.Now.Add(duration);
|
||||
memberData.MutedUntil = DateTimeOffset.UtcNow.Add(duration);
|
||||
if (data.Preferences["RemoveRolesOnMute"] is "true") {
|
||||
memberData.Roles = toMute.RoleIds.ToList();
|
||||
memberData.Roles.Remove(cmd.Context.Guild.Id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue