Skip to content

Commit

Permalink
optional params are never senders
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal committed Jul 10, 2022
1 parent 7f0f712 commit 1dbfc01
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SenderContextResolverFactory(List<SenderResolver> resolvers) {

@Override public @Nullable ContextResolver<?> create(@NotNull CommandParameter parameter) {
if (parameter.getMethodIndex() != 0) return null;
if (parameter.hasAnnotation(Default.class) || parameter.hasAnnotation(NotSender.class)) return null;
if (parameter.isOptional() || parameter.hasAnnotation(NotSender.class)) return null;
for (SenderResolver resolver : resolvers) {
if (resolver.isCustomType(parameter.getType())) {
return context -> notNull(resolver.getSender(parameter.getType(), context.actor(), context.command()),
Expand Down

0 comments on commit 1dbfc01

Please sign in to comment.