All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.freya02.botcommands.api.commands.application.annotations.NSFW Maven / Gradle / Ivy

package com.freya02.botcommands.api.commands.application.annotations;

import com.freya02.botcommands.api.core.SettingsProvider;
import net.dv8tion.jda.api.entities.User;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Only for text commands, for application commands, see the {@code #nsfw} parameter of your annotation
 *
 * 

* * Marks the annotated element as being for use in NSFW channels only *
Using it on a method will override the values inherited from the class *
NSFW commands will be shown in help content only if called in an NSFW channel, otherwise not shown, DM consent is not checked as text commands are guild-only */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) public @interface NSFW { /** * Specifies whether this NSFW command should work in guild channels * * @return true if the command should run on guild channel */ boolean guild() default true; /** * Specifies whether this NSFW command should work in a users DMs *
The user also needs to consent to NSFW DMs * * @return true if the command should run in users DMs * @see SettingsProvider#doesUserConsentNSFW(User) */ boolean dm() default false; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy