Class UnsafeSlashCommand
-
- All Implemented Interfaces:
-
com.kotlindiscord.kord.extensions.koin.KordExKoinComponent,com.kotlindiscord.kord.extensions.types.Lockable,org.koin.core.component.KoinComponent
public final class UnsafeSlashCommand<A extends Arguments, M extends ModalForm> extends SlashCommand<UnsafeSlashCommandContext<A, M>, A, M>
Like a standard slash command, but with less safety features.
-
-
Field Summary
Fields Modifier and Type Field Description private InitialSlashCommandResponseinitialResponseprivate final Function0<A>argumentsprivate final Function0<M>modalprivate final SlashCommand<?, ?, ?>parentCommandprivate final SlashGroupparentGroupprivate BooleanallowByDefaultprivate BooleanallowInDmsprivate SuspendFunction2<UnsafeSlashCommandContext<A, M>, M, Unit>bodyprivate Stringbundleprivate final List<SuspendFunction1<CheckContextWithCache<ChatInputCommandInteractionCreateEvent>, Unit>>checkListprivate final ComponentRegistrycomponentRegistryprivate PermissionsdefaultMemberPermissionsprivate Stringdescriptionprivate final Extensionextensionprivate final Map<String, SlashGroup>groupsprivate SnowflakeguildIdprivate final BooleanhasBodyprivate final Kordkordprivate final KLoggerkxLoggerprivate final Localized<String>localizedDescriptionprivate final Localized<String>localizedNameprivate Booleanlockingprivate final Stringmentionprivate Mutexmutexprivate Stringnameprivate final Map<Locale, String>nameTranslationCacheprivate final ApplicationCommandRegistryregistryprivate final Set<Permission>requiredPermsprivate final StringresolvedBundleprivate final SentryAdaptersentryprivate final ExtensibleBotBuildersettingsprivate final List<SlashCommand<?, ?, ?>>subCommandsprivate final TranslationsProvidertranslationsProviderprivate final ApplicationCommandTypetype
-
Constructor Summary
Constructors Constructor Description UnsafeSlashCommand(Extension extension, Function0<A> arguments, Function0<M> modal, SlashCommand<?, ?, ?> parentCommand, SlashGroup parentGroup)
-
Method Summary
Modifier and Type Method Description final InitialSlashCommandResponsegetInitialResponse()Initial response type. final UnitsetInitialResponse(InitialSlashCommandResponse initialResponse)Initial response type. Function0<A>getArguments()Function0<M>getModal()SlashCommand<?, ?, ?>getParentCommand()SlashGroupgetParentGroup()Unitcall(ChatInputCommandInteractionCreateEvent event, Map<String, Object> cache)Unitrun(ChatInputCommandInteractionCreateEvent event, Map<String, Object> cache)UnitrespondText(UnsafeSlashCommandContext<A, M> context, String message, FailureReason<?> failureType)-
Methods inherited from class com.kotlindiscord.kord.extensions.commands.application.ApplicationCommand
check, check, doCall, getAllowByDefault, getAllowInDms, getCheckList, getDefaultMemberPermissions, getLocalizedName, getRegistry, getRequiredPerms, guild, guild, guild, localize, requireBotPermissions, requirePermission, runStandardChecks, setAllowByDefault, setAllowInDms, setDefaultMemberPermissions -
Methods inherited from class com.kotlindiscord.kord.extensions.commands.application.slash.SlashCommand
action, findCommand, findCommand, findCommand, firstSentryBreadcrumb, getBody, getComponentRegistry, getDescription, getGroups, getGuildId, getHasBody, getKxLogger, getLocalizedDescription, getMention, getSubCommands, getType, handleError, runChecks, setBody, setDescription, setGuildId, validate -
Methods inherited from class com.kotlindiscord.kord.extensions.commands.Command
checkBotPerms, emitEventAsync, getBundle, getExtension, getKord, getLocking, getMutex, getName, getNameTranslationCache, getResolvedBundle, getSentry, getSettings, getTranslationsProvider, setBundle, setLocking, setMutex, setName -
Methods inherited from class com.kotlindiscord.kord.extensions.koin.KordExKoinComponent
getKoin -
Methods inherited from class com.kotlindiscord.kord.extensions.types.Lockable
lock, unlock, withLock -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getInitialResponse
final InitialSlashCommandResponse getInitialResponse()
Initial response type. Change this to decide what happens when this slash command is executed.
-
setInitialResponse
final Unit setInitialResponse(InitialSlashCommandResponse initialResponse)
Initial response type. Change this to decide what happens when this slash command is executed.
-
getArguments
Function0<A> getArguments()
-
getParentCommand
SlashCommand<?, ?, ?> getParentCommand()
-
getParentGroup
SlashGroup getParentGroup()
-
respondText
Unit respondText(UnsafeSlashCommandContext<A, M> context, String message, FailureReason<?> failureType)
-
-
-
-