diff --git a/VpSharp.Commands/Attributes/ExecutionChecks/RequireBotOwnerAttribute.cs b/VpSharp.Commands/Attributes/ExecutionChecks/RequireBotOwnerAttribute.cs index d3a54cf..9c2e3c6 100644 --- a/VpSharp.Commands/Attributes/ExecutionChecks/RequireBotOwnerAttribute.cs +++ b/VpSharp.Commands/Attributes/ExecutionChecks/RequireBotOwnerAttribute.cs @@ -9,6 +9,6 @@ public sealed class RequireBotOwnerAttribute : PreExecutionCheckAttribute protected internal override Task PerformAsync(CommandContext context) { ArgumentNullException.ThrowIfNull(context); - return Task.FromResult(context.Avatar.User.Id == context.Client.CurrentUser?.Id); + return Task.FromResult(context.Avatar.UserId == context.Client.CurrentUser?.Id); } } diff --git a/VpSharp.Commands/Attributes/ExecutionChecks/RequireUserIdAttribute.cs b/VpSharp.Commands/Attributes/ExecutionChecks/RequireUserIdAttribute.cs index cfeefd6..35d7cdc 100644 --- a/VpSharp.Commands/Attributes/ExecutionChecks/RequireUserIdAttribute.cs +++ b/VpSharp.Commands/Attributes/ExecutionChecks/RequireUserIdAttribute.cs @@ -40,6 +40,6 @@ public sealed class RequireUserIdAttribute : PreExecutionCheckAttribute protected internal override Task PerformAsync(CommandContext context) { ArgumentNullException.ThrowIfNull(context); - return Task.FromResult(UserIds.Contains(context.Avatar.User.Id)); + return Task.FromResult(UserIds.Contains(context.Avatar.UserId)); } } diff --git a/VpSharp.Commands/Attributes/ExecutionChecks/RequireUserNameAttribute.cs b/VpSharp.Commands/Attributes/ExecutionChecks/RequireUserNameAttribute.cs index 7847a1f..de275f8 100644 --- a/VpSharp.Commands/Attributes/ExecutionChecks/RequireUserNameAttribute.cs +++ b/VpSharp.Commands/Attributes/ExecutionChecks/RequireUserNameAttribute.cs @@ -1,4 +1,6 @@ -namespace VpSharp.Commands.Attributes.ExecutionChecks; +using VpSharp.Entities; + +namespace VpSharp.Commands.Attributes.ExecutionChecks; #pragma warning disable CA1019 // Define accessors for attribute arguments @@ -37,9 +39,10 @@ public sealed class RequireUserNameAttribute : PreExecutionCheckAttribute public IReadOnlyList Names { get; } /// - protected internal override Task PerformAsync(CommandContext context) + protected internal override async Task PerformAsync(CommandContext context) { ArgumentNullException.ThrowIfNull(context); - return Task.FromResult(Names.Contains(context.Avatar.User.Name)); + VirtualParadiseUser user = await context.Avatar.GetUserAsync().ConfigureAwait(false); + return Names.Contains(user.Name); } }