All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m42s
66 lines
1.6 KiB
Java
66 lines
1.6 KiB
Java
package cc.fascinated.bat.common.command;
|
|
|
|
import lombok.AccessLevel;
|
|
import lombok.Getter;
|
|
import lombok.NonNull;
|
|
import lombok.Setter;
|
|
import net.dv8tion.jda.api.Permission;
|
|
|
|
/**
|
|
* The internal command info of a {@link BatCommand}.
|
|
*
|
|
* @author Braydon
|
|
*/
|
|
@Setter(AccessLevel.PROTECTED) @Getter
|
|
public class InternalCommandInfo {
|
|
/**
|
|
* The name of the command.
|
|
*/
|
|
@NonNull private final String name;
|
|
|
|
/**
|
|
* The description of the command.
|
|
*/
|
|
@NonNull private final String description;
|
|
|
|
/**
|
|
* The category of the command.
|
|
*/
|
|
@NonNull private Category category;
|
|
|
|
/**
|
|
* The permissions required to run this command, if any.
|
|
*/
|
|
private Permission[] permissions;
|
|
|
|
/**
|
|
* Whether this command can only be ran within a guild.
|
|
*/
|
|
private boolean guildOnly;
|
|
|
|
/**
|
|
* Whether this command can be user installed.
|
|
*/
|
|
private final boolean userInstall;
|
|
|
|
/**
|
|
* Whether the command can only be ran by the bot owner.
|
|
*/
|
|
private boolean botOwnerOnly;
|
|
|
|
/**
|
|
* Whether the command can be ran with a prefix.
|
|
*/
|
|
private boolean prefixAllowed;
|
|
|
|
protected InternalCommandInfo(@NonNull CommandInfo annotation) {
|
|
name = annotation.name();
|
|
description = annotation.description();
|
|
category = annotation.category();
|
|
permissions = annotation.requiredPermissions();
|
|
guildOnly = annotation.guildOnly() && !annotation.userInstall();
|
|
userInstall = annotation.userInstall();
|
|
botOwnerOnly = annotation.botOwnerOnly();
|
|
prefixAllowed = annotation.prefixAllowed();
|
|
}
|
|
} |