mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-26 09:28:47 +00:00
fix: amend 63e775855a
This commit is contained in:
parent
63e775855a
commit
d6cd882e0a
@ -9,6 +9,6 @@ public sealed class RequireBotOwnerAttribute : PreExecutionCheckAttribute
|
|||||||
protected internal override Task<bool> PerformAsync(CommandContext context)
|
protected internal override Task<bool> PerformAsync(CommandContext context)
|
||||||
{
|
{
|
||||||
ArgumentNullException.ThrowIfNull(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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,6 @@ public sealed class RequireUserIdAttribute : PreExecutionCheckAttribute
|
|||||||
protected internal override Task<bool> PerformAsync(CommandContext context)
|
protected internal override Task<bool> PerformAsync(CommandContext context)
|
||||||
{
|
{
|
||||||
ArgumentNullException.ThrowIfNull(context);
|
ArgumentNullException.ThrowIfNull(context);
|
||||||
return Task.FromResult(UserIds.Contains(context.Avatar.User.Id));
|
return Task.FromResult(UserIds.Contains(context.Avatar.UserId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
#pragma warning disable CA1019 // Define accessors for attribute arguments
|
||||||
|
|
||||||
@ -37,9 +39,10 @@ public sealed class RequireUserNameAttribute : PreExecutionCheckAttribute
|
|||||||
public IReadOnlyList<string> Names { get; }
|
public IReadOnlyList<string> Names { get; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected internal override Task<bool> PerformAsync(CommandContext context)
|
protected internal override async Task<bool> PerformAsync(CommandContext context)
|
||||||
{
|
{
|
||||||
ArgumentNullException.ThrowIfNull(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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user