Package com.mrivanplays.jdcf.builtin
Class CommandShutdown
- java.lang.Object
-
- com.mrivanplays.jdcf.Command
-
- com.mrivanplays.jdcf.builtin.CommandShutdown
-
@CommandAliases("shutdown") @MarkGuildOnly public class CommandShutdown extends Command
Represents a shutdown command. Due to okhttp bug the shutdown isn't being properly executed byJDA.shutdown()
and so some okhttp threads get left causing the bot to not stop so not save any prefixes or such and so this is why this command was born. You should register it by yourself and so this is why no settings are being present about it intoCommandSettings
-
-
Constructor Summary
Constructors Constructor Description CommandShutdown(@NotNull java.lang.String botOwnerId)
Creates a new shutdown command instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
execute(@NotNull CommandExecutionContext context, @NotNull CommandArguments args)
JDCF calls this method when the command was triggered from a message.boolean
hasPermission(@NotNull PermissionCheckContext context)
An overridable method which checks if the member has the required permission to execute the command.
-
-
-
Method Detail
-
hasPermission
public boolean hasPermission(@NotNull @NotNull PermissionCheckContext context)
An overridable method which checks if the member has the required permission to execute the command.- Overrides:
hasPermission
in classCommand
- Parameters:
context
- permission check context- Returns:
true
if has,false
otherwise
-
execute
public boolean execute(@NotNull @NotNull CommandExecutionContext context, @NotNull @NotNull CommandArguments args)
JDCF calls this method when the command was triggered from a message. This will always happen when the command name was prefixed with the bot's prefix. According to settings inCommandManager
it also might happen when the bot was mentioned except of the bot prefix. Also according to settings inCommandManager
prefixes may vary between servers.
-
-