Package com.reign.kat.lib.command
Class Context
java.lang.Object
com.reign.kat.lib.command.Context
- Direct Known Subclasses:
ButtonInteractionContext
,MessageContext
,SlashCommandContext
,VoiceContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of command argumentsfinal net.dv8tion.jda.api.entities.Member
Member who invoked the commandfinal net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
Guild TextChannel the command was sent in.final Command
Invoked commandfinal net.dv8tion.jda.api.entities.channel.concrete.PrivateChannel
PrivateChannel the command was sent in.final net.dv8tion.jda.api.entities.Guild
Guild the command was sent in.final net.dv8tion.jda.api.JDA
final net.dv8tion.jda.api.entities.channel.middleman.AudioChannel
The VoiceChannel the author is in. -
Constructor Summary
ConstructorsConstructorDescriptionContext
(VoiceCommandEvent event, Command command, List<String> args) Context
(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event, Command command, List<String> args) Context
(net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent event, Command command, List<String> args) Context
(net.dv8tion.jda.api.events.message.MessageReceivedEvent event, Command command, List<String> args) -
Method Summary
Modifier and TypeMethodDescriptionboolean
net.dv8tion.jda.api.entities.channel.middleman.MessageChannel
channel()
abstract net.dv8tion.jda.api.events.Event
event()
net.dv8tion.jda.api.interactions.InteractionHook
hook()
boolean
isDM()
boolean
isGuild()
abstract String
prefix()
void
Alias to send(String...void
reply
(net.dv8tion.jda.api.entities.MessageEmbed... embeds) Alias to send(MessageEmbed...abstract void
abstract void
send
(net.dv8tion.jda.api.entities.MessageEmbed... embeds) void
Reply to the user with a generic error embedvoid
sendError
(net.dv8tion.jda.api.entities.MessageEmbed... embeds) Reply to the user with error an embed(s)
-
Field Details
-
jda
public final net.dv8tion.jda.api.JDA jda -
args
List of command arguments -
command
Invoked command -
author
public final net.dv8tion.jda.api.entities.Member authorMember who invoked the command -
channel
public final net.dv8tion.jda.api.entities.channel.middleman.GuildChannel channelGuild TextChannel the command was sent in. null if not in a guild -
dmChannel
public final net.dv8tion.jda.api.entities.channel.concrete.PrivateChannel dmChannelPrivateChannel the command was sent in. null if not in a DM -
voiceChannel
public final net.dv8tion.jda.api.entities.channel.middleman.AudioChannel voiceChannelThe VoiceChannel the author is in. null if not in a voiceChannel / is a DM -
guild
public final net.dv8tion.jda.api.entities.Guild guildGuild the command was sent in. null if not in a guild
-
-
Constructor Details
-
Context
-
Context
-
Context
-
Context
-
-
Method Details
-
event
public abstract net.dv8tion.jda.api.events.Event event() -
prefix
-
send
-
send
public abstract void send(net.dv8tion.jda.api.entities.MessageEmbed... embeds) -
canProvideInteractionHook
public boolean canProvideInteractionHook() -
hook
public net.dv8tion.jda.api.interactions.InteractionHook hook() -
reply
Alias to send(String... msgs)- Parameters:
msgs
- String messages to send
-
reply
public void reply(net.dv8tion.jda.api.entities.MessageEmbed... embeds) Alias to send(MessageEmbed... embeds)- Parameters:
embeds
- MessageEmbed embeds to send
-
sendError
Reply to the user with a generic error embed -
sendError
public void sendError(net.dv8tion.jda.api.entities.MessageEmbed... embeds) Reply to the user with error an embed(s) -
channel
public net.dv8tion.jda.api.entities.channel.middleman.MessageChannel channel() -
isGuild
public boolean isGuild() -
isDM
public boolean isDM()
-