Browse Source

return error when precondition fails

pull/1978/head
Sean GitHub 3 years ago
parent
commit
244f9a5b2c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Interactions/Attributes/Preconditions/RequireRoleAttribute.cs

+ 1
- 1
src/Discord.Net.Interactions/Attributes/Preconditions/RequireRoleAttribute.cs View File

@@ -62,7 +62,7 @@ namespace Discord.Interactions
if (guildUser.Guild.Roles.Any(x => x.Name == RoleName))
return Task.FromResult(PreconditionResult.FromSuccess());
else
Task.FromResult(PreconditionResult.FromError(ErrorMessage ?? $"User requires guild role {RoleName}."));
return Task.FromResult(PreconditionResult.FromError(ErrorMessage ?? $"User requires guild role {RoleName}."));
}

return Task.FromResult(PreconditionResult.FromSuccess());


Loading…
Cancel
Save